Skip to content

Fix crash with NUL character in path given to --file-list - #8902

Open
mcc0612mcc0612 wants to merge 1 commit into
cppcheck-opensource:mainfrom
mcc0612mcc0612:fix-nul-in-path
Open

mcc0612mcc0612 wants to merge 1 commit into
cppcheck-opensource:mainfrom
mcc0612mcc0612:fix-nul-in-path

Conversation

@mcc0612mcc0612

Copy link
Copy Markdown

Description
If a path in the --file-list file contains a NUL character, cppcheck keeps opening the same folder over and over until it crashes

Crash Replication

mkdir -p d/s; printf 'd\0\n' > list.txt  && /path/to/cppcheck --file-list=list.txt

seg fault is expected

Proposed Patch
If a path in --file-list file contains NUL character, reject it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant