Skip to content

Commit e465b9e

Browse files
fixes for -fsanitize=memory
1 parent 670d43a commit e465b9e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

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)