summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2015-09-21 13:31:27 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2015-09-21 13:31:27 +0000
commit4517b1fec41408d7b52b61b1e9090be8ae8b5d33 (patch)
tree1a819617d58c1503e897204044c2caef13452597 /usr.bin
parent24e7c4dd68d9ca4296f6378c13a951b1f8d678ad (diff)
add a couple of missing NULL checks
noted by Bill Parker (dogbert2) on github
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/openssl/ca.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/openssl/ca.c b/usr.bin/openssl/ca.c
index a4f00ee62c0..e32abcdf211 100644
--- a/usr.bin/openssl/ca.c
+++ b/usr.bin/openssl/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.15 2015/09/21 13:13:06 bcook Exp $ */
+/* $OpenBSD: ca.c,v 1.16 2015/09/21 13:31:26 bcook Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1928,7 +1928,7 @@ again2:
tm = X509_get_notAfter(ret);
row[DB_exp_date] = malloc(tm->length + 1);
- if (row[DB_exp_date] == NULL) {
+ if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {
BIO_printf(bio_err, "Memory allocation failure\n");
goto err;
}
@@ -2181,7 +2181,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value)
tm = X509_get_notAfter(x509);
row[DB_exp_date] = malloc(tm->length + 1);
- if (row[DB_exp_date] == NULL) {
+ if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {
BIO_printf(bio_err, "Memory allocation failure\n");
goto err;
}