From bdb0dada4bf633a135655b3ba12d5fbf2e2dab39 Mon Sep 17 00:00:00 2001 From: Jason Constam Date: Mon, 18 Jul 2022 08:46:28 -0600 Subject: [PATCH] Prevent maybe-initialized error * By default, Mongoose OS uses -Werror * The ret variable in mbedtls_hmac_drbg_update_ret is declared without assignment. * GCC will treat this as a compiler error unless the maybe-initialized error is completely disabled --- library/hmac_drbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index b45d61616..04ce74829 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -97,7 +97,7 @@ int mbedtls_hmac_drbg_update_ret( mbedtls_hmac_drbg_context *ctx, unsigned char rounds = ( additional != NULL && add_len != 0 ) ? 2 : 1; unsigned char sep[1]; unsigned char K[MBEDTLS_MD_MAX_SIZE]; - int ret; + int ret = MBEDTLS_ERR_MD_BAD_INPUT_DATA; for( sep[0] = 0; sep[0] < rounds; sep[0]++ ) {