Kaydet (Commit) c8835f2f authored tarafından Eike Rathke's avatar Eike Rathke

Related: tdf#118073 SbiScanner::NextSym: no symbol is no symbol

Whatever may or may not advance or put back nLineIdx, if there's
no progress at the end return false so we don't end up in an
endless loop with the next NextSym() starting at the same
position.

Change-Id: I7084fea073490c15b8ff5abb3781ac82cdccd6d6
Reviewed-on: https://gerrit.libreoffice.org/56029Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 5c0783ce
......@@ -226,6 +226,8 @@ bool SbiScanner::NextSym()
nOldCol1 = nOldCol2 = 0;
}
const sal_Int32 nLineIdxScanStart = nLineIdx;
if(nCol < aLine.getLength() && BasicCharClass::isWhitespace(aLine[nCol]))
{
bSpaces = true;
......@@ -632,6 +634,13 @@ PrevLineCommentLbl:
nCol2 = nCol2 + nLen;
nLineIdx = -1;
}
if (nLineIdx == nLineIdxScanStart)
{
GenError( ERRCODE_BASIC_SYMBOL_EXPECTED );
return false;
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment