Check the return value of make_config_name() before attempting to use
authorlteo <lteo@openbsd.org>
Fri, 18 Apr 2014 18:07:59 +0000 (18:07 +0000)
committerlteo <lteo@openbsd.org>
Fri, 18 Apr 2014 18:07:59 +0000 (18:07 +0000)
the config filename.

ok beck@

lib/libssl/src/apps/openssl.c

index 9f01e3c..008bbdc 100644 (file)
@@ -258,8 +258,13 @@ main(int Argc, char *ARGV[])
        p = getenv("OPENSSL_CONF");
        if (p == NULL)
                p = getenv("SSLEAY_CONF");
-       if (p == NULL)
+       if (p == NULL) {
                p = to_free = make_config_name();
+               if (p == NULL) {
+                       BIO_printf(bio_err, "error making config file name\n");
+                       goto end;
+               }
+       }
 
        default_config_file = p;