Skip to content

Commit

Permalink
Fix #12454 fuzzing crash (assert) in CheckUninitVar::checkLoopBodyRec…
Browse files Browse the repository at this point in the history
…ursive()
  • Loading branch information
chrchr-github committed Feb 21, 2024
1 parent 49ce02f commit b8aed49
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/checkuninitvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void CheckUninitVar::checkScope(const Scope* scope, const std::set<std::string>
if (!tok)
continue;

if (tok->astParent() && Token::simpleMatch(tok->astParent()->previous(), "for (") &&
if (tok->astParent() && Token::simpleMatch(tok->astParent()->previous(), "for (") && Token::simpleMatch(tok->astParent()->link()->next(), "{") &&
checkLoopBody(tok->astParent()->link()->next(), var, var.isArray() ? ARRAY : NO_ALLOC, emptyString, true))
continue;

Expand Down
Binary file not shown.

0 comments on commit b8aed49

Please sign in to comment.