Commit 2d9f351
zwave_api: Harden zwapi_connection.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. 19:
Potentially overflowing call to snprintf
More refactoring can be done in later change
Origin: SiliconLabsSoftware#113
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 fe344dc commit 2d9f351
File tree
1 file changed
+31
-5
lines changed- applications/zpc/components/zwave_api/src
1 file changed
+31
-5
lines changedLines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
54 | 62 | | |
55 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
58 | 85 | | |
59 | | - | |
60 | | - | |
| 86 | + | |
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
| |||
0 commit comments