mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 14:32:49 +03:00
[crypto] Return a NULL X.509 certificate if construction fails
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1068,6 +1068,7 @@ int x509_certificate ( const void *data, size_t len,
|
|||||||
/* Parse certificate */
|
/* Parse certificate */
|
||||||
if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) {
|
if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) {
|
||||||
x509_put ( *cert );
|
x509_put ( *cert );
|
||||||
|
*cert = NULL;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user