diff options
author | bcook <> | 2015-09-21 13:31:26 +0000 |
---|---|---|
committer | bcook <> | 2015-09-21 13:31:26 +0000 |
commit | 01ede7f10ce7b20eb1c9323b7f50daefc23564ff (patch) | |
tree | 4b44b30817da297435d25a0264d5652e33468772 | |
parent | a7268eae9e45cb1dc601928389cd071cc6f36afa (diff) | |
download | openbsd-01ede7f10ce7b20eb1c9323b7f50daefc23564ff.tar.gz openbsd-01ede7f10ce7b20eb1c9323b7f50daefc23564ff.tar.bz2 openbsd-01ede7f10ce7b20eb1c9323b7f50daefc23564ff.zip |
add a couple of missing NULL checks
noted by Bill Parker (dogbert2) on github
-rw-r--r-- | src/usr.bin/openssl/ca.c | 6 |
1 files 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 @@ | |||
1 | /* $OpenBSD: ca.c,v 1.15 2015/09/21 13:13:06 bcook Exp $ */ | 1 | /* $OpenBSD: ca.c,v 1.16 2015/09/21 13:31:26 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 | * |
@@ -1928,7 +1928,7 @@ again2: | |||
1928 | 1928 | ||
1929 | tm = X509_get_notAfter(ret); | 1929 | tm = X509_get_notAfter(ret); |
1930 | row[DB_exp_date] = malloc(tm->length + 1); | 1930 | row[DB_exp_date] = malloc(tm->length + 1); |
1931 | if (row[DB_exp_date] == NULL) { | 1931 | if (row[DB_type] == NULL || row[DB_exp_date] == NULL) { |
1932 | BIO_printf(bio_err, "Memory allocation failure\n"); | 1932 | BIO_printf(bio_err, "Memory allocation failure\n"); |
1933 | goto err; | 1933 | goto err; |
1934 | } | 1934 | } |
@@ -2181,7 +2181,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value) | |||
2181 | 2181 | ||
2182 | tm = X509_get_notAfter(x509); | 2182 | tm = X509_get_notAfter(x509); |
2183 | row[DB_exp_date] = malloc(tm->length + 1); | 2183 | row[DB_exp_date] = malloc(tm->length + 1); |
2184 | if (row[DB_exp_date] == NULL) { | 2184 | if (row[DB_type] == NULL || row[DB_exp_date] == NULL) { |
2185 | BIO_printf(bio_err, "Memory allocation failure\n"); | 2185 | BIO_printf(bio_err, "Memory allocation failure\n"); |
2186 | goto err; | 2186 | goto err; |
2187 | } | 2187 | } |