summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/x509.c
diff options
context:
space:
mode:
authorbcook <>2015-09-21 13:32:55 +0000
committerbcook <>2015-09-21 13:32:55 +0000
commit8cd2e8a8ed69b1bd5763b94d2864fc4854e7deb4 (patch)
treeadb59c5ad8cd4b7adff540f7b112f47adf107c66 /src/usr.bin/openssl/x509.c
parent01ede7f10ce7b20eb1c9323b7f50daefc23564ff (diff)
downloadopenbsd-8cd2e8a8ed69b1bd5763b94d2864fc4854e7deb4.tar.gz
openbsd-8cd2e8a8ed69b1bd5763b94d2864fc4854e7deb4.tar.bz2
openbsd-8cd2e8a8ed69b1bd5763b94d2864fc4854e7deb4.zip
add a missing NULL check
noted by Bill Parker (dogbert2) on github
Diffstat (limited to 'src/usr.bin/openssl/x509.c')
-rw-r--r--src/usr.bin/openssl/x509.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/usr.bin/openssl/x509.c b/src/usr.bin/openssl/x509.c
index d0a6bcaa00..8699e9eef0 100644
--- a/src/usr.bin/openssl/x509.c
+++ b/src/usr.bin/openssl/x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.c,v 1.7 2015/09/21 13:13:06 bcook Exp $ */ 1/* $OpenBSD: x509.c,v 1.8 2015/09/21 13:32:55 bcook Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -721,6 +721,10 @@ bad:
721 721
722 z = i2d_X509(x, NULL); 722 z = i2d_X509(x, NULL);
723 m = malloc(z); 723 m = malloc(z);
724 if (m == NULL) {
725 BIO_printf(bio_err, "out of mem\n");
726 goto end;
727 }
724 728
725 d = (unsigned char *) m; 729 d = (unsigned char *) m;
726 z = i2d_X509_NAME(X509_get_subject_name(x), &d); 730 z = i2d_X509_NAME(X509_get_subject_name(x), &d);