Checkio: fixed potential NULL-pointer dereference (Coverity-ScanId: CID 1113428).

This commit is contained in:
Martin Ettl 2013-10-31 20:03:05 +01:00
parent 5156481db4
commit 897533ab93
1 changed files with 1 additions and 1 deletions

View File

@ -417,7 +417,7 @@ static bool findFormat(unsigned int arg, const Token *firstArg,
*formatStringTok = argTok;
return true;
} else if (Token::Match(argTok, "%var% [,)]") &&
(argTok->variable() &&
(argTok && argTok->variable() &&
Token::Match(argTok->variable()->typeStartToken(), "char|wchar_t") &&
(argTok->variable()->isPointer() ||
(argTok->variable()->dimensions().size() == 1 &&