diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-11-06 20:53:13 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-11-07 01:34:34 +0100 |
commit | 5effaa90f38d55f035d381ad8982d2ed6b9d46de (patch) | |
tree | d34e74ef7269690149971ee99de011225a525214 /idl | |
parent | 614e04019a672cdd61b86699d99250d80f169f95 (diff) |
idl: fix out of bounds string accesses
Change-Id: Id0d07ff9bcd4858cb74458eaf13fb9386387f455
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/lex.hxx | 4 | ||||
-rw-r--r-- | idl/source/cmptools/lex.cxx | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx index 238f5b904d20..2f816358bca8 100644 --- a/idl/inc/lex.hxx +++ b/idl/inc/lex.hxx @@ -140,7 +140,9 @@ class SvTokenStream int GetNextChar(); int GetFastNextChar() { - return aBufStr[nBufPos++]; + return (nBufPos < aBufStr.getLength()) + ? aBufStr[nBufPos++] + : '\0'; } void FillTokenList(); diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index d6644b8e1297..3e131ee7bf43 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -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; |