Kaydet (Commit) 10dc6605 authored tarafından Michael Stahl's avatar Michael Stahl

vcl: PPDParser: fix out of bounds string accesses

Change-Id: I1793a58fa107b190f8412bbc3376009f3b85c6b0
üst c98fc675
......@@ -680,7 +680,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
while( ! aStream.IsEof() )
{
OString aCurLine = aStream.ReadLine();
if( aCurLine[0] == '*' )
if (!aCurLine.isEmpty() && aCurLine[0] == '*')
{
if (aCurLine.matchIgnoreAsciiCase(OString("*include:")))
{
......@@ -952,7 +952,7 @@ void PPDParser::parse( ::std::list< OString >& rLines )
{
OString aCurrentLine( *line );
++line;
if( aCurrentLine[0] != '*' )
if (aCurrentLine.getLength() < 2 || aCurrentLine[0] != '*')
continue;
if( aCurrentLine[1] == '%' )
continue;
......
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