Commit a80b7eb
Fix crash with NUL character in path given to --file-list (#8902)
**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**
```shell
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: chencheng mao <u1520758@utah.edu>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent 1349826 commit a80b7eb
2 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
0 commit comments