Commit a16ce46
utils: Harden zpc_converters.c by checking snprintf
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. 12:
Potentially overflowing call to snprintf
Origin: SiliconLabsSoftware#121
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 <[email protected]>1 parent 063f413 commit a16ce46
1 file changed
+8
-4
lines changedLines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
55 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
0 commit comments