Skip to content

Commit 3a3184d

Browse files
Fix #14917 fuzzing crash (null-pointer-use) in ReverseTraversal::traverse() (#8800)
Co-authored-by: chrchr-github <noreply@github.com>
1 parent c6109ba commit 3a3184d

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lib/tokenize.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3768,6 +3768,9 @@ void Tokenizer::concatenateNegativeNumberAndAnyPositive()
37683768
if (tok->findOpeningBracket())
37693769
continue;
37703770

3771+
if (!tok->tokAt(2) || (tok->tokAt(2)->isOp() && !Token::Match(tok->tokAt(2), "[+-]")))
3772+
syntaxError(tok);
3773+
37713774
while (tok->str() != ">" && tok->next() && tok->strAt(1) == "+" && (!Token::Match(tok->tokAt(2), "%name% (|;") || Token::Match(tok, "%op%")))
37723775
tok->deleteNext();
37733776

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
n(S=n){n*,+&&n}

0 commit comments

Comments
 (0)