Repository navigation
Commit f0d6a28
fix: resolve remaining static-analysis security findings (OpenSSF)
Fixes the static_analysis_fixed findings still open in TODO.md:
- map2check.cpp: replace the new[]+strcpy+putenv pattern (CWE-119,
clang-analyzer-security.insecureAPI.strcpy) with setenv(), which
copies its arguments — also removes the deliberately leaked buffers
- NonDetGeneratorKlee.c and NonDetGeneratorLibFuzzy.c:
map2check_non_det_pchar returned a pointer to a local VLA (cppcheck
returnDanglingLifetime); now heap-allocates the string. The LibFuzzy
copy of the pattern was not listed in TODO.md but was flagged by
cppcheck during verification
- NonDetGeneratorLibFuzzy.c: cast get_next_input_from_fuzzer() to
uint64_t before shifting — uint8_t promotes to int, and shifting an
int by up to 56 bits is undefined behavior
- NonDetLog.c: zero-initialize NONDET_CALL in new_nondet_call (the id
field was never set and the row is persisted to disk by the BTree
container); fix %d vs unsigned printf specifiers found by cppcheck
Verified in the CI Docker image (clang-16): full build with KLEE and
LibFuzzer enabled compiles and map2check --version runs (exercising
the setenv path); cppcheck exits 0 on the three C files; the 6-test
suite passes under strict ASan/UBSan and under Valgrind memcheck with
0 defects.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 0a0e6c0 commit f0d6a28
4 files changed
Lines changed: 28 additions & 26 deletions
File tree
- modules
- backend/library/lib
- frontend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 96 | + | |
101 | 97 | | |
| 98 | + | |
102 | 99 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 100 | + | |
109 | 101 | | |
110 | 102 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 103 | + | |
115 | 104 | | |
116 | 105 | | |
117 | 106 | | |
| |||
0 commit comments