diff options
author | Brent Cook <bcook@cvs.openbsd.org> | 2015-09-21 13:31:27 +0000 |
---|---|---|
committer | Brent Cook <bcook@cvs.openbsd.org> | 2015-09-21 13:31:27 +0000 |
commit | 4517b1fec41408d7b52b61b1e9090be8ae8b5d33 (patch) | |
tree | 1a819617d58c1503e897204044c2caef13452597 /usr.bin | |
parent | 24e7c4dd68d9ca4296f6378c13a951b1f8d678ad (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.c | 6 |
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; } |