Merge remote-tracking branch 'origin/pr/2813' into mbedtls-2.16

* origin/pr/2813:
  Fix uninitialized variable in x509_crt
This commit is contained in:
Jaeden Amero 2019-09-03 16:34:23 +01:00
commit fe1d66d3e2
2 changed files with 7 additions and 6 deletions

View File

@ -25,6 +25,9 @@ Bugfix
address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE. address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE.
* Fix memory leak in in mpi_miller_rabin(). Contributed by * Fix memory leak in in mpi_miller_rabin(). Contributed by
Jens Wiklander <jens.wiklander@linaro.org> in #2363 Jens Wiklander <jens.wiklander@linaro.org> 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 Changes
* Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h * Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h

View File

@ -2087,15 +2087,13 @@ check_signature:
continue; continue;
} }
*r_parent = parent;
*r_signature_is_good = signature_is_good;
break; break;
} }
if( parent != NULL ) if( parent == NULL )
{
*r_parent = parent;
*r_signature_is_good = signature_is_good;
}
else
{ {
*r_parent = fallback_parent; *r_parent = fallback_parent;
*r_signature_is_good = fallback_signature_is_good; *r_signature_is_good = fallback_signature_is_good;