Skip to content

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

Merged
danmar merged 2 commits into
cppcheck-opensource:mainfrom
mcc0612mcc0612:fix-nul-in-path
Oct 2, 2026
Merged

danmar merged 2 commits into
cppcheck-opensource:mainfrom
mcc0612mcc0612:fix-nul-in-path

Conversation

@mcc0612mcc0612

Copy link
Copy Markdown
Contributor

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>
Comment thread cli/filelister.cpp Outdated
Comment thread test/testfilelister.cpp
@danmar
danmar merged commit a80b7eb into cppcheck-opensource:main Oct 2, 2026
71 checks passed
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