Fixed #6011 (crash: libreoffice/binfilter svt_enhwmf.cxx)

This commit is contained in:
Daniel Marjamäki 2014-07-28 16:33:42 +02:00
parent fdfea717c6
commit 8a1c5d6fce
1 changed files with 2 additions and 0 deletions

View File

@ -2891,6 +2891,8 @@ void CheckOther::checkSuspiciousStringCompare()
const Token* varTok = tok->astOperand1();
const Token* litTok = tok->astOperand2();
if (!varTok || !litTok) // <- failed to create AST for comparison
continue;
if (varTok->type() == Token::eString || varTok->type() == Token::eNumber)
std::swap(varTok, litTok);
else if (litTok->type() != Token::eString && litTok->type() != Token::eNumber)