Skip to content

Commit b7ed413

Browse files
committed
wolfcrypt/src/wc_lms_impl.c: work around false-positive -Wmaybe-uninitialized in wc_lms_treehash_update().
1 parent 29c5b02 commit b7ed413

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

wolfcrypt/src/wc_lms_impl.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,10 +2418,12 @@ static int wc_lms_treehash_update(LmsState* state, LmsPrivState* privState,
24182418
}
24192419
}
24202420

2421-
if (!useRoot && (ret == 0)) {
2422-
/* Copy stack back. */
2423-
XMEMCPY(stackCache->stack, stack, params->height * params->hash_len);
2424-
stackCache->offset = (word32)((size_t)sp - (size_t)stack);
2421+
if (ret == 0) {
2422+
if (!useRoot) {
2423+
/* Copy stack back. */
2424+
XMEMCPY(stackCache->stack, stack, params->height * params->hash_len);
2425+
stackCache->offset = (word32)((size_t)sp - (size_t)stack);
2426+
}
24252427
}
24262428

24272429
WC_FREE_VAR_EX(stack, NULL, DYNAMIC_TYPE_TMP_BUFFER);

0 commit comments

Comments
 (0)