diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-05 19:16:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-06 00:31:16 +0100 |
commit | b3f1d199a72ce87cb65ddaeac922564f57da6a4d (patch) | |
tree | 3487d5e99192255ede4b76a9e4a23c38601e13e0 /svtools/source | |
parent | 4058d85963e371be657f531d8f30e31381a9ccab (diff) |
ofz infinite loop
Change-Id: I9eab92f72618a062455e9e17d9a262f28d8bb740
Reviewed-on: https://gerrit.libreoffice.org/44332
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/svrtf/parrtf.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 7ef29c77e289..cd2b4537c0dc 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -305,7 +305,7 @@ sal_Unicode SvRTFParser::GetHexValue() void SvRTFParser::ScanText() { - const sal_Unicode cBreak = 0; + const sal_Unicode cBreak = 0; OUStringBuffer aStrBuffer; bool bContinue = true; while( bContinue && IsParserWorking() && aStrBuffer.getLength() < MAX_STRING_LEN) @@ -333,12 +333,16 @@ void SvRTFParser::ScanText() aByteString.append(c); bool bBreak = false; + bool bEOF = false; sal_Char nSlash = '\\'; while (!bBreak) { auto next = GetNextChar(); if (sal_Unicode(EOF) == next) + { + bEOF = true; break; + } if (next>0xFF) // fix for #i43933# and #i35653# { if (!aByteString.isEmpty()) @@ -364,6 +368,12 @@ void SvRTFParser::ScanText() } } + if (bEOF) + { + bContinue = false; // abort, string together + break; + } + nNextCh = GetNextChar(); if (nSlash != '\\' || nNextCh != '\'') |