diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-27 12:17:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-27 16:51:40 +0200 |
commit | f98040a273b14e8e3f4b7206d4e6c8b93dde262f (patch) | |
tree | a8e4d983028a64f319f77b5a9c0d028995bbdf38 /svtools/source/svrtf/svparser.cxx | |
parent | 8100a41597637165f364849e6964fdcf8906e5b7 (diff) |
another stab at the ofx infinite rtf loop
Change-Id: I2dcc186fd7118a85e2059d061fc4cac555c96ee8
Reviewed-on: https://gerrit.libreoffice.org/51944
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 'svtools/source/svrtf/svparser.cxx')
-rw-r--r-- | svtools/source/svrtf/svparser.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 27e6c1eede3d..4ba540ce96d9 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -76,6 +76,7 @@ SvParser<T>::SvParser( SvStream& rIn, sal_uInt8 nStackSize ) , nlLineNr( 1 ) , nlLinePos( 1 ) , pImplData( nullptr ) + , m_nTokenIndex(0) , nTokenValue( 0 ) , bTokenHasValue( false ) , eState( SvParserState::NotStarted ) @@ -475,6 +476,7 @@ T SvParser<T>::GetNextToken() bTokenHasValue = pTokenStackPos->bTokenHasValue; aToken = pTokenStackPos->sToken; nRet = pTokenStackPos->nTokenId; + ++m_nTokenIndex; } // no, now push actual value on stack else if( SvParserState::Working == eState ) @@ -483,6 +485,7 @@ T SvParser<T>::GetNextToken() pTokenStackPos->nTokenValue = nTokenValue; pTokenStackPos->bTokenHasValue = bTokenHasValue; pTokenStackPos->nTokenId = nRet; + ++m_nTokenIndex; } else if( SvParserState::Accepted != eState && SvParserState::Pending != eState ) eState = SvParserState::Error; // an error occurred @@ -501,6 +504,8 @@ T SvParser<T>::SkipToken( short nCnt ) // "skip" n Tokens backward nTmp = nTokenStackSize; nTokenStackPos = sal_uInt8(nTmp); + m_nTokenIndex -= nTmp; + // restore values aToken = pTokenStackPos->sToken; nTokenValue = pTokenStackPos->nTokenValue; |