From 01ede7f10ce7b20eb1c9323b7f50daefc23564ff Mon Sep 17 00:00:00 2001 From: bcook <> Date: Mon, 21 Sep 2015 13:31:26 +0000 Subject: add a couple of missing NULL checks noted by Bill Parker (dogbert2) on github --- src/usr.bin/openssl/ca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c index a4f00ee62c..e32abcdf21 100644 --- a/src/usr.bin/openssl/ca.c +++ b/src/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; } -- cgit v1.2.3-55-g6feb