Skip to content

Commit

Permalink
tokenize.cpp: fixed fuzzing crash in setScopeInfo() (#6092)
Browse files Browse the repository at this point in the history
Co-authored-by: chrchr-github <[email protected]>
  • Loading branch information
firewave and chrchr-github authored Apr 2, 2024
1 parent 5c5d6a8 commit f722f08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,10 +1253,9 @@ void Tokenizer::simplifyTypedefCpp()
Token *namespaceEnd = nullptr;

// check for invalid input
if (!tokOffset)
if (!tokOffset || tokOffset->isControlFlowKeyword())
syntaxError(tok);


if (tokOffset->str() == "::") {
typeStart = tokOffset;
tokOffset = tokOffset->next();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{for(typedef;);}

0 comments on commit f722f08

Please sign in to comment.