1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Fix memory leak on error in pkcs7_get_signers_info_set

mbedtls_x509_name allocates memory, which must be freed if there is a
subsequent error.

Credit to OSS-Fuzz (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53811).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-11-27 22:02:10 +01:00
parent e7f8c616d0
commit 4f01121f6e
3 changed files with 4 additions and 1 deletions

View File

@ -387,7 +387,7 @@ static int pkcs7_get_signers_info_set( unsigned char **p, unsigned char *end,
ret = pkcs7_get_signer_info( p, end_set, signers_set );
if( ret != 0 )
return( ret );
goto cleanup;
count++;
mbedtls_pkcs7_signer_info *prev = signers_set;