Skip to content

Commit 34037e2

Browse files
authored
Merge pull request #187 from JacobBarthelmeh/memory_scan
fixes for -fsanitize=memory
2 parents 670d43a + e465b9e commit 34037e2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/benchmark/clu_benchmark.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ int wolfCLU_benchmark(int timer, int* option)
9797
wc_RNG_GenerateBlock(&rng, iv, AES_BLOCK_SIZE);
9898
start = wolfCLU_getTime();
9999

100+
wc_AesInit(&aes, HEAP_HINT, INVALID_DEVID);
100101
wc_AesSetKey(&aes, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION);
101102

102103
while (loop) {
@@ -107,6 +108,7 @@ int wolfCLU_benchmark(int timer, int* option)
107108
/* if stop >= timer, loop = 0 */
108109
loop = (stop >= timer) ? 0 : 1;
109110
}
111+
wc_AesFree(&aes);
110112
printf("\n");
111113
printf("AES-CBC ");
112114
wolfCLU_stats(start, AES_BLOCK_SIZE, blocks);

src/pkcs/clu_pkcs7.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ int wolfCLU_PKCS7(int argc, char** argv)
7171
int derContentSz = 0;
7272
int freePkcs7 = 0;
7373

74+
XMEMSET(&pkcs7, 0, sizeof(PKCS7));
75+
7476
opterr = 0; /* do not display unrecognized options */
7577
optind = 0; /* start at indent 0 */
7678
while ((option = wolfCLU_GetOpt(argc, argv, "",

0 commit comments

Comments
 (0)