summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-11-07 00:49:15 +0100
committerMichael Stahl <mstahl@redhat.com>2013-11-07 01:34:32 +0100
commit10dc66052ae1bd5f8ba4be1554ab9654d2af3e93 (patch)
tree7884b89acd7c501d37c2058b5f8625bb6b5e13e6 /vcl
parentc98fc675df85b0d54c0c10c9c7e9e30716c927d2 (diff)
vcl: PPDParser: fix out of bounds string accesses
Change-Id: I1793a58fa107b190f8412bbc3376009f3b85c6b0
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 0ec20554b178..7d286e03ed8c 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -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;