Skip to content

Commit 8e5682d

Browse files
Fix #14437 fuzzing crash (null-pointer-use) in ValueFlowAnalyzer::assume() (#8730)
1 parent fdd6067 commit 8e5682d

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6920,7 +6920,7 @@ Token *Tokenizer::simplifyAddBracesToCommand(Token *tok)
69206920
// before the "while"
69216921
if (tokEnd) {
69226922
tokEnd=tokEnd->next();
6923-
if (!tokEnd || tokEnd->str()!="while") // no while
6923+
if (!Token::simpleMatch(tokEnd, "while (") || !Token::simpleMatch(tokEnd->linkAt(1), ") ;")) // no while
69246924
syntaxError(tok);
69256925
}
69266926
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d o(n c){do if(c){}while(0)n}

0 commit comments

Comments
 (0)