Commit 5118755
committed
fix(s2): Harden S2_init_ctx using safe memset
This is a simple change to check the static analysis.
SonarQube is reporting:
This "memset" is likely to be optimized away by the compiler; either remove it or replace it with "memset_s".
While memset_s is suggested it is not implemented widely (it is optional),
at this stage i am following GNU standards until it stabilizes.
One other possible change it to harden compilation flags with:
-fno-builtin-memset
Origin: SiliconLabsSoftware#137
Relate-to: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm
Relate-to: https://en.cppreference.com/w/c/string/byte/memset
Relate-to: https://sourceware.org/glibc/manual/2.41/html_node/Erasing-Sensitive-Data.html
Relate-to: SiliconLabsSoftware#100
Relate-to: https://github.com/SiliconLabsSoftware/z-wave-engine-application-layer/issues/42
Relate-to: https://sourceware.org/bugzilla/show_bug.cgi?id=17879#c2
Signed-off-by: Philippe Coval <[email protected]>1 parent 575a894 commit 5118755
File tree
1 file changed
+3
-3
lines changed- applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol
1 file changed
+3
-3
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1279 | 1279 | | |
1280 | 1280 | | |
1281 | 1281 | | |
1282 | | - | |
| 1282 | + | |
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | | - | |
| 1332 | + | |
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
| |||
2054 | 2054 | | |
2055 | 2055 | | |
2056 | 2056 | | |
2057 | | - | |
| 2057 | + | |
0 commit comments