summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-01-19 14:48:45 +0000
committerMatt Caswell <matt@openssl.org>2018-01-22 10:07:41 +0000
commit1e05c6d07ff963107286d028f6778d2ccc863a9a (patch)
tree662bd3fbb3397b00bf4c89b663e4d74b84bc2f74 /apps/ca.c
parente505f1e86874acfd98826d64c53bf2ddfd9c1399 (diff)
Don't crash on a missing Subject in index.txt
An index.txt entry which has an empty Subject name field will cause ca to crash. Therefore check it when we load it to make sure its not empty. Fixes #5109 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5114)
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 551d0aa2f8..9b1d9bdaac 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -663,6 +663,10 @@ end_of_options:
goto end;
}
}
+ if (pp[DB_name][0] == '\0') {
+ BIO_printf(bio_err, "entry %d: bad Subject\n", i + 1);
+ goto end;
+ }
}
if (verbose) {
TXT_DB_write(bio_out, db->db);