Skip to content

Commit f722f08

Browse files
tokenize.cpp: fixed fuzzing crash in setScopeInfo() (#6092)
Co-authored-by: chrchr-github <chrchr-github@users.noreply.github.com>
1 parent 5c5d6a8 commit f722f08

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,10 +1253,9 @@ void Tokenizer::simplifyTypedefCpp()
12531253
Token *namespaceEnd = nullptr;
12541254

12551255
// check for invalid input
1256-
if (!tokOffset)
1256+
if (!tokOffset || tokOffset->isControlFlowKeyword())
12571257
syntaxError(tok);
12581258

1259-
12601259
if (tokOffset->str() == "::") {
12611260
typeStart = tokOffset;
12621261
tokOffset = tokOffset->next();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{for(typedef;);}

0 commit comments

Comments
 (0)