Fixed CID-1234716: Dereference after null check in lib/checkio.cpp

This commit is contained in:
Martin Ettl 2014-09-01 09:00:05 +02:00
parent e8f7279039
commit 8a15486370
1 changed files with 7 additions and 6 deletions

View File

@ -181,8 +181,8 @@ void CheckIO::checkFileUsage()
(windows && tok->str() == "_fseeki64")) {
if (_settings->isEnabled("portability") && tok->str() == "fflush") {
fileTok = tok->tokAt(2);
if (fileTok && fileTok->str() == "stdin")
if (fileTok) {
if (fileTok->str() == "stdin")
fflushOnInputStreamError(tok, fileTok->str());
else {
Filepointer& f = filepointers[fileTok->varId()];
@ -190,6 +190,7 @@ void CheckIO::checkFileUsage()
fflushOnInputStreamError(tok, fileTok->str());
}
}
}
fileTok = tok->tokAt(2);
operation = Filepointer::POSITIONING;