Kaydet (Commit) 5effaa90 authored tarafından Michael Stahl's avatar Michael Stahl

idl: fix out of bounds string accesses

Change-Id: Id0d07ff9bcd4858cb74458eaf13fb9386387f455
üst 614e0401
......@@ -140,7 +140,9 @@ class SvTokenStream
int GetNextChar();
int GetFastNextChar()
{
return aBufStr[nBufPos++];
return (nBufPos < aBufStr.getLength())
? aBufStr[nBufPos++]
: '\0';
}
void FillTokenList();
......
......@@ -151,9 +151,9 @@ void SvTokenStream::FillTokenList()
int SvTokenStream::GetNextChar()
{
int nChar;
if( aBufStr.getLength() < nBufPos )
while (aBufStr.getLength() <= nBufPos)
{
if( rInStream.ReadLine( aBufStr ) )
if (rInStream.ReadLine(aBufStr))
{
nLine++;
nColumn = 0;
......
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