Skip to content

Commit d18b4b2

Browse files
authored
Merge pull request #9676 from night1rider/fix-sha256-inter-init
initialize i_shaCopy to prevent undefined behavior
2 parents f587872 + 7a89451 commit d18b4b2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4863,6 +4863,9 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t sha256_test(void)
48634863
#endif
48644864

48654865
XMEMSET(&shaCopy, 0, sizeof(shaCopy));
4866+
#ifndef NO_WOLFSSL_SHA256_INTERLEAVE
4867+
XMEMSET(&i_shaCopy, 0, sizeof(i_shaCopy));
4868+
#endif
48664869

48674870
for (i = 0; i < times; ++i) {
48684871
ret = wc_Sha256Update(&sha, (byte*)test_sha[i].input,

0 commit comments

Comments
 (0)