From 8ce496a1279264e97fabf50501505b1ed54ea306 Mon Sep 17 00:00:00 2001 From: IOBYTE Date: Wed, 24 Jan 2018 15:19:52 -0500 Subject: [PATCH] Fix possible null pointer dereference cppcheck warning. (#1056) --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e3e6ca6eb..ca852ca5d 100755 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -99,7 +99,7 @@ const Token * Tokenizer::isFunctionHead(const Token *tok, const std::string &end tok = tok->next(); while (tok && tok->str() == "[") tok = tok->link()->next(); - return (endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr; + return (tok && endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr; } if (cpp && tok->str() == ")") { tok = tok->next();