Commit f1c5d53
z_rx: Harden zwave_rx_print_protocol_version in zwave_rx.c
Checking snprintf results, reminder :
If the output was truncated due to this limit, then the return
value is the number of characters (excluding the terminating
null byte) which would have been written to the final string if
enough space had been available
This was found using CodeQL:
Potential fix for code scanning alert no. 15:
Potentially overflowing call to snprintf
For the record this function escape the git commit to hex form (in ascii)
Origin: SiliconLabsSoftware#104
Relate-to: SiliconLabsSoftware#100
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>1 parent 786e54c commit f1c5d53
1 file changed
Lines changed: 16 additions & 9 deletions
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
121 | | - | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
219 | | - | |
| 226 | + | |
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| |||
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
232 | 239 | | |
233 | 240 | | |
234 | 241 | | |
| |||
0 commit comments