We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d86373f commit e6b6e42Copy full SHA for e6b6e42
applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c
@@ -1279,7 +1279,17 @@ S2_init_ctx(uint32_t home)
1279
return 0;
1280
}
1281
#endif
1282
+
1283
+ // Erase sensitive memory safely
1284
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
1285
+ memset_explicit(ctx, 0, sizeof(struct S2));
1286
+#elif defined(HAVE_EXPLICIT_BZERO) // for gcc-12
1287
explicit_bzero(ctx, sizeof(struct S2));
1288
+#elif defined(__APPLE__) // for MacOS
1289
+ memset_s(ctx, 0, sizeof(struct S2));
1290
+#else
1291
+ memset(ctx, 0, sizeof(struct S2)); //NOSONAR: Fallback option
1292
+#endif
1293
1294
ctx->my_home_id = home;
1295
ctx->loaded_keys = 0;
0 commit comments