summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-28 10:42:19 +0000
committerAndras Timar <andras.timar@collabora.com>2021-01-12 11:13:35 +0100
commit2468ff2f3f8d124db785db80365311c460954d51 (patch)
tree6327748a27b4989d66f4aeb1a5c2ff328fcc30bd /svtools
parent49b5cd7dd76ae7bbab12fc1316f713b884928466 (diff)
ofz#13513 infinite loop with negative value for \bin
Change-Id: Ia2960598a837b3d0c48125980137171aa7944adb Reviewed-on: https://gerrit.libreoffice.org/83986 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svrtf/parrtf.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index a7e3f64f226e..abc5ffde2cbe 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
+#include <sal/log.hxx>
#include <rtl/character.hxx>
#include <rtl/strbuf.hxx>
@@ -547,7 +548,9 @@ void SvRTFParser::SkipGroup()
if (nToken == RTF_BIN)
{
rInput.SeekRel(-1);
- rInput.SeekRel(nTokenValue);
+ SAL_WARN_IF(nTokenValue < 0, "svtools", "negative value argument for rtf \\bin keyword");
+ if (nTokenValue > 0)
+ rInput.SeekRel(nTokenValue);
nNextCh = GetNextChar();
}
while (nNextCh==0xa || nNextCh==0xd)