Skip to content

Commit

Permalink
Fix heap hint usage in wc_RNG_HealthTest
Browse files Browse the repository at this point in the history
Pass provided heap hint to XMALLOC instead of NULL in RNG health test
function to ensure proper memory allocation with custom heap.
  • Loading branch information
gasbytes committed Jan 2, 2025
1 parent 239b85c commit fb7899b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wolfcrypt/src/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -2184,7 +2184,7 @@ static int wc_RNG_HealthTestLocal(int reseed, void* heap, int devId)
#endif

#ifdef WOLFSSL_SMALL_STACK
check = (byte*)XMALLOC(RNG_HEALTH_TEST_CHECK_SIZE, NULL,
check = (byte*)XMALLOC(RNG_HEALTH_TEST_CHECK_SIZE, heap,
DYNAMIC_TYPE_TMP_BUFFER);
if (check == NULL) {
return MEMORY_E;
Expand Down

0 comments on commit fb7899b

Please sign in to comment.