Skip to content

Commit

Permalink
Fix #12492 fuzzing crash (stack overflow) in CheckLeakAutoVar::checkT…
Browse files Browse the repository at this point in the history
…okenInsideExpression()
  • Loading branch information
chrchr-github committed Mar 13, 2024
1 parent 54f46d3 commit ea23882
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ static bool iscast(const Token *tok, bool cpp)
if (Token::simpleMatch(tok->link(), ") ( )"))
return false;

if (Token::Match(tok->link(), ") %assign%"))
return false;

if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return" &&
(!cpp || !Token::Match(tok->previous(), "delete|throw")))
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_(){w((char)=e)}

0 comments on commit ea23882

Please sign in to comment.