diff --git a/ChangeLog b/ChangeLog index 77d9d81cd..b9f46166f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,9 @@ Bugfix * Fix propagation of restart contexts in restartable EC operations. This could previously lead to segmentation faults in builds using an address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE. + * 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 * Replace multiple uses of MD2 by SHA-256 in X.509 test suite. Fixes #821. diff --git a/library/x509_crt.c b/library/x509_crt.c index b2c19db68..48f244e2e 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2611,15 +2611,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;