diff --git a/ChangeLog b/ChangeLog index f523d264c..9c980ae2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,9 @@ Bugfix address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE. * Fix memory leak in in mpi_miller_rabin(). Contributed by Jens Wiklander in #2363 + * Improve code clarity in x509_crt module, removing false-positive + uninitialized variable warnings on some recent toolchains (GCC8, etc). + Discovered and fixed by Andy Gross (Linaro), #2392. Changes * Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h diff --git a/library/x509_crt.c b/library/x509_crt.c index 56d7a3127..9c2e36547 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2087,15 +2087,13 @@ check_signature: continue; } + *r_parent = parent; + *r_signature_is_good = signature_is_good; + break; } - if( parent != NULL ) - { - *r_parent = parent; - *r_signature_is_good = signature_is_good; - } - else + if( parent == NULL ) { *r_parent = fallback_parent; *r_signature_is_good = fallback_signature_is_good;