summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2015-09-21 13:32:56 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2015-09-21 13:32:56 +0000
commitf0c6b979258ea0893699d53cd39fd7bd26266875 (patch)
tree9eedf730e066379c3bf5f962f58f9a1af7187165 /usr.bin
parent4517b1fec41408d7b52b61b1e9090be8ae8b5d33 (diff)
add a missing NULL check
noted by Bill Parker (dogbert2) on github
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/openssl/x509.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/openssl/x509.c b/usr.bin/openssl/x509.c
index d0a6bcaa001..8699e9eef08 100644
--- a/usr.bin/openssl/x509.c
+++ b/usr.bin/openssl/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.7 2015/09/21 13:13:06 bcook Exp $ */
+/* $OpenBSD: x509.c,v 1.8 2015/09/21 13:32:55 bcook Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -721,6 +721,10 @@ bad:
z = i2d_X509(x, NULL);
m = malloc(z);
+ if (m == NULL) {
+ BIO_printf(bio_err, "out of mem\n");
+ goto end;
+ }
d = (unsigned char *) m;
z = i2d_X509_NAME(X509_get_subject_name(x), &d);