main: avoid a NULL dereference on initialisation.
authorPauli <paul.dale@oracle.com>
Thu, 21 Nov 2019 03:50:03 +0000 (13:50 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 22 Nov 2019 05:22:57 +0000 (15:22 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10495)

apps/openssl.c

index 66189ca434c42c225fda78b76d1b4c9f246b0cd0..31f598815aa8f761d948cd1cca0113ae0bf8aab7 100644 (file)
@@ -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 */