diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-06 12:57:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-06 18:33:02 +0100 |
commit | e4551b905e12aa92b7509d9b994bfae5dec3d8e0 (patch) | |
tree | f5fae8db42321ea918db50b756c7b24434afae55 /editeng | |
parent | f037207675010fdff2c1968a67fae5b0c2c34331 (diff) |
ofz infinite loop
Change-Id: Iae9faaa86e4b3edb9a1fdfe9c6b67eee211c19a9
Reviewed-on: https://gerrit.libreoffice.org/44361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index f84a30ff026c..568abc078757 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -294,8 +294,11 @@ void SvxRTFParser::ReadStyleTable() bIsInReadStyleTab = true; bChkStyleAttr = false; // Do not check Attribute against the Styles - while( _nOpenBrakets && IsParserWorking() ) + bool bLooping = false; + + while (_nOpenBrakets && IsParserWorking() && !bLooping) { + auto nCurrentTokenIndex = m_nTokenIndex; int nToken = GetNextToken(); switch( nToken ) { @@ -378,6 +381,7 @@ void SvxRTFParser::ReadStyleTable() } break; } + bLooping = nCurrentTokenIndex == m_nTokenIndex; } pStyle.reset(); // Delete the Last Style SkipToken(); // the closing brace is evaluated "above" |