Skip to content

Fix #14918: fuzzing crash (stack-overflow) in findTokensSkipDeadCodeImpl()#8732

Open
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14918-stack-overflow
Open

Fix #14918: fuzzing crash (stack-overflow) in findTokensSkipDeadCodeImpl()#8732
ludviggunne wants to merge 2 commits into
cppcheck-opensource:mainfrom
ludviggunne:14918-stack-overflow

Conversation

@ludviggunne

Copy link
Copy Markdown
Collaborator

No description provided.

@firewave

Copy link
Copy Markdown
Collaborator

FYI multiple post-in/decrements are invalid but it is valid for pre-in/decrement.

@ludviggunne

Copy link
Copy Markdown
Collaborator Author

FYI multiple post-in/decrements are invalid but it is valid for pre-in/decrement.

Hm, I get this when I try it:

tmp $ cat main.c
int main(void)
{
        int x;
        ++++x;
}
tmp $ gcc -c main.c
main.c: In function ‘main’:
main.c:4:9: error: lvalue required as increment operand
    4 |         ++++x;
      |         ^~

@ludviggunne

Copy link
Copy Markdown
Collaborator Author

FYI multiple post-in/decrements are invalid but it is valid for pre-in/decrement.

Hm, I get this when I try it:

tmp $ cat main.c
int main(void)
{
        int x;
        ++++x;
}
tmp $ gcc -c main.c
main.c: In function ‘main’:
main.c:4:9: error: lvalue required as increment operand
    4 |         ++++x;
      |         ^~

I suppose it can be made to work with operator overloading. I will add a language check.

@ludviggunne ludviggunne force-pushed the 14918-stack-overflow branch from 491d30c to 15b6a74 Compare July 15, 2026 13:54
@firewave

firewave commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Ah, it is only allowed in C++.

It is also not handled by us - I filed https://trac.cppcheck.net/ticket/14920 about it.

@ludviggunne ludviggunne force-pushed the 14918-stack-overflow branch from 15b6a74 to b78df5d Compare July 15, 2026 15:02
@firewave

Copy link
Copy Markdown
Collaborator
CMake Error (install-absolute-destination) at cli/CMakeLists.txt:42 (install):
  INSTALL command given absolute DESTINATION path:

    C:/Program Files/Cppcheck/bin
This error is for project developers.  Use -Wno-error=author or
-Wno-error=install-absolute-destination to suppress it.

This is caused by a behavior change in CMake 4.4 (which is not rolled out on all runners yet).

@firewave

Copy link
Copy Markdown
Collaborator

I filed https://trac.cppcheck.net/ticket/14922 about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants