Skip to content

Commit bf76975

Browse files
Fix #13712 fuzzing crash (stack overflow) in Token::typeDecl() (danmar#8108)
Co-authored-by: chrchr-github <noreply@github.com>
1 parent c74eb2a commit bf76975

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
@@ -8943,6 +8943,8 @@ void Tokenizer::findGarbageCode() const
89438943
syntaxError(tok->next());
89448944
if (Token::Match(tok, "%name% %op% %name%") && !tok->isKeyword() && tok->next()->isIncDecOp())
89458945
syntaxError(tok->next());
8946+
if (!tok->isKeyword() && Token::Match(tok, "%name% .|-> %name% %name%") && !tok->tokAt(2)->isKeyword())
8947+
syntaxError(tok);
89468948
if (Token::Match(tok, "[!|+-/%^~] )|]"))
89478949
syntaxError(tok);
89488950
if (Token::Match(tok, "==|!=|<=|>= %comp%") && tok->strAt(-1) != "operator")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
n f(){auto x=i->o x}

0 commit comments

Comments
 (0)