From: Pauli Date: Thu, 21 Nov 2019 03:50:03 +0000 (+1000) Subject: main: avoid a NULL dereference on initialisation. X-Git-Tag: openssl-3.0.0-alpha1~916 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=acc7b9fb5c162c2ca522e5e1e09d1efbde8dc6a0;p=oweals%2Fopenssl.git main: avoid a NULL dereference on initialisation. Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/10495) --- diff --git a/apps/openssl.c b/apps/openssl.c index 66189ca434..31f598815a 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -276,6 +276,13 @@ int main(int argc, char *argv[]) } prog = prog_init(); + if (prog == NULL) { + BIO_printf(bio_err, + "FATAL: Startup failure (dev note: prog_init() failed)\n"); + ERR_print_errors(bio_err); + ret = 1; + goto end; + } pname = opt_progname(argv[0]); /* first check the program name */