From 8e1e46ebb505e6973860839e4dee8e89f575ee1f Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 8 Feb 2021 22:02:12 +0100 Subject: [PATCH] Fix the use of unitialized memory with MBEDTLS_TEST_NULL_ENTROPY Signed-off-by: Gilles Peskine --- library/entropy_poll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/entropy_poll.c b/library/entropy_poll.c index 5250a7bfec..27465f27d3 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c @@ -205,13 +205,13 @@ int mbedtls_null_entropy_poll( void *data, { ((void) data); ((void) output); - *olen = 0; + *olen = 0; if( len < sizeof(unsigned char) ) return( 0 ); + output[0] = 0; *olen = sizeof(unsigned char); - return( 0 ); } #endif