diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-28 12:23:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-28 16:10:38 +0100 |
commit | 8f6af557890ae687592075099a02960155511bd5 (patch) | |
tree | 0a1ba4e8552cbff5fab99e0c33d3aa3f4bf1437e /vcl/unx/generic | |
parent | f2a39e1d9184b7cda32b713b699d19ac3d023849 (diff) |
Resolves: tdf#112215 null deref on missing optional ppd value
Change-Id: Iba45437332df963e1aa213c587071ab293f36390
Reviewed-on: https://gerrit.libreoffice.org/64164
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 105a350a27d6..7789459c200c 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -848,13 +848,22 @@ PPDParser::PPDParser( const OUString& rFile ) : } // fill in direct values - if( (pKey = getKey( OUString( "ColorDevice" ) )) ) - m_bColorDevice = pKey->getValue( 0 )->m_aValue.startsWithIgnoreAsciiCase( "true" ); + if ((pKey = getKey(OUString("ColorDevice")))) + { + if (const PPDValue* pValue = pKey->getValue(0)) + m_bColorDevice = pValue->m_aValue.startsWithIgnoreAsciiCase("true"); + } - if( (pKey = getKey( OUString( "LanguageLevel" ) )) ) - m_nLanguageLevel = pKey->getValue( 0 )->m_aValue.toInt32(); - if( (pKey = getKey( OUString( "TTRasterizer" ) )) ) - m_bType42Capable = pKey->getValue( 0 )->m_aValue.equalsIgnoreAsciiCase( "Type42" ); + if ((pKey = getKey(OUString("LanguageLevel")))) + { + if (const PPDValue* pValue = pKey->getValue(0)) + m_nLanguageLevel = pValue->m_aValue.toInt32(); + } + if ((pKey = getKey(OUString("TTRasterizer")))) + { + if (const PPDValue* pValue = pKey->getValue(0)) + m_bType42Capable = pValue->m_aValue.equalsIgnoreAsciiCase( "Type42" ); + } } PPDParser::~PPDParser() |