Commit a3d684ff authored by Matt Caswell's avatar Matt Caswell
Browse files

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: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5115)
parent dd37f6f1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -880,6 +880,10 @@ int MAIN(int argc, char **argv)
            }
            p++;
        }
        if (pp[DB_name][0] == '\0') {
            BIO_printf(bio_err, "entry %d: bad Subject\n", i + 1);
            goto err;
        }
    }
    if (verbose) {
        BIO_set_fp(out, stdout, BIO_NOCLOSE | BIO_FP_TEXT); /* cannot fail */