summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-28 10:42:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-28 13:30:54 +0100
commit8849e38f4f46b832d75d310021de8414ece1101d (patch)
treecddb3028171172f1892714968cf2d3da2610d3a4
parent208ca3d33d4e6dff9e70a3efa098628b02151729 (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>
-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 349ca2e37bb6..c3a43bf8a34d 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>
@@ -557,7 +558,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)