summaryrefslogtreecommitdiffstats
path: root/src/crypto/x509.c
diff options
context:
space:
mode:
authorMichael Brown2012-05-22 00:00:08 +0200
committerMichael Brown2012-05-22 00:21:36 +0200
commitc923d57663183da3b738dbc9f999d3e2e620305b (patch)
tree3d4be4c7b8f5183ee562f367370fa35edc1edecb /src/crypto/x509.c
parent[crypto] Accept UTCTime/GeneralizedTime with no "seconds" field (diff)
downloadipxe-c923d57663183da3b738dbc9f999d3e2e620305b.tar.gz
ipxe-c923d57663183da3b738dbc9f999d3e2e620305b.tar.xz
ipxe-c923d57663183da3b738dbc9f999d3e2e620305b.zip
[crypto] Return a NULL X.509 certificate if construction fails
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/x509.c')
-rw-r--r--src/crypto/x509.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/crypto/x509.c b/src/crypto/x509.c
index 18a8cebe..2180173b 100644
--- a/src/crypto/x509.c
+++ b/src/crypto/x509.c
@@ -1068,6 +1068,7 @@ int x509_certificate ( const void *data, size_t len,
/* Parse certificate */
if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) {
x509_put ( *cert );
+ *cert = NULL;
return rc;
}