From: Pauli Date: Sun, 26 Apr 2020 23:16:04 +0000 (+1000) Subject: coverity 1462572 Dereference after null check X-Git-Tag: openssl-3.0.0-alpha2~115 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cb383f10d1fe5e9020280952caea4fa9c2e4139d;p=oweals%2Fopenssl.git coverity 1462572 Dereference after null check Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11651) --- diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 1a23ae0846..6facdf3e5b 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -420,9 +420,13 @@ static int load_pkcs12(BIO *in, const char *desc, char tpass[PEM_BUFSIZE]; int len, ret = 0; PKCS12 *p12; + p12 = d2i_PKCS12_bio(in, NULL); - if (p12 == NULL && desc != NULL) { - BIO_printf(bio_err, "Error loading PKCS12 file for %s\n", desc); + if (p12 == NULL) { + if (desc != NULL) + BIO_printf(bio_err, "Error loading PKCS12 file for %s\n", desc); + else + BIO_printf(bio_err, "Error loading PKCS12 file\n"); goto die; } /* See if an empty password will do */