Skip to content

Commit 3676dc0

Browse files
committed
wolfcrypt/benchmark/benchmark.c: mollify scan-build with XMEMSET()s in several false positives around WC_DECLARE_ARRAY().
1 parent 44e0ee1 commit 3676dc0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

wolfcrypt/benchmark/benchmark.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8940,6 +8940,11 @@ void bench_dh(int useDeviceID)
89408940
WC_DECLARE_VAR(priv2, byte,
89418941
BENCH_DH_PRIV_SIZE, HEAP_HINT);
89428942

8943+
/* old scan-build misfires -Wmaybe-uninitialized on these. */
8944+
XMEMSET(pub, 0, sizeof(pub));
8945+
XMEMSET(agree, 0, sizeof(agree));
8946+
XMEMSET(priv, 0, sizeof(priv));
8947+
89438948
WC_CALLOC_ARRAY(dhKey, DhKey, BENCH_MAX_PENDING,
89448949
sizeof(DhKey), HEAP_HINT);
89458950
WC_ALLOC_ARRAY(pub, byte,
@@ -10348,6 +10353,11 @@ void bench_ecc(int useDeviceID, int curveId)
1034810353
BENCH_MAX_PENDING, MAX_ECC_BYTES, HEAP_HINT);
1034910354
#endif
1035010355

10356+
/* old scan-build misfires -Wmaybe-uninitialized on these. */
10357+
XMEMSET(sig, 0, sizeof(sig));
10358+
XMEMSET(digest, 0, sizeof(digest));
10359+
XMEMSET(shared, 0, sizeof(shared));
10360+
1035110361
WC_CALLOC_ARRAY(genKey, ecc_key, BENCH_MAX_PENDING,
1035210362
sizeof(ecc_key), HEAP_HINT);
1035310363
#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC

0 commit comments

Comments
 (0)