Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8962,6 +8962,8 @@ void Tokenizer::findGarbageCode() const
const Token* const endTok = tok->linkAt(1);
for (tok = tok->tokAt(2); tok != endTok; tok = tok->next()) {
if (const Token* lam = findLambdaEndTokenWithoutAST(tok)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tok is nullptr this call would "fail" and thus we would still deref it below. IS this something to address or should we wait for fuzzed variant which will actually trigger that?

@chrchr-github chrchr-github Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fine for now since tok cannot be set to endTok anywhere else (findLambdaEndTokenWithoutAST() returns the Token after }).
precedes() cannot be used because token indices don't exist yet.

if (lam == endTok)
break;
tok = lam;
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{for([]{});}
Loading