Skip to content

Commit 466839e

Browse files
Fix #13705 fuzzing crash (null-pointer-use) in getEnumType() (danmar#8103)
Co-authored-by: chrchr-github <noreply@github.com>
1 parent 105ea18 commit 466839e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/tokenize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8955,6 +8955,8 @@ void Tokenizer::findGarbageCode() const
89558955
if (Token::Match(tok, "!|~ %comp%") &&
89568956
!(cpp && tok->strAt(1) == ">" && Token::simpleMatch(tok->tokAt(-1), "operator")))
89578957
syntaxError(tok);
8958+
if (Token::Match(tok, "%comp% {") && (!cpp || tok->str() != ">"))
8959+
syntaxError(tok);
89588960
if (Token::Match(tok, "] %name%") && (!cpp || !(tok->tokAt(1)->isKeyword() || (tok->tokAt(-1) && Token::simpleMatch(tok->tokAt(-2), "delete ["))))) {
89598961
if (tok->next()->isUpperCaseName())
89608962
unknownMacroError(tok->next());
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{f F<{enum{E=1};}>}

0 commit comments

Comments
 (0)