Fix OPENSSL_config with NULL parameter
authorRoumen Petrov <openssl@roumenpetrov.info>
Fri, 12 Feb 2016 20:18:59 +0000 (22:18 +0200)
committerRich Salz <rsalz@openssl.org>
Thu, 18 Feb 2016 15:25:23 +0000 (10:25 -0500)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/conf/conf_sap.c

index 2021a02..e70fb7a 100644 (file)
@@ -81,7 +81,8 @@ void OPENSSL_config(const char *config_name)
     OPENSSL_INIT_SETTINGS settings;
 
     memset(&settings, 0, sizeof(settings));
     OPENSSL_INIT_SETTINGS settings;
 
     memset(&settings, 0, sizeof(settings));
-    settings.config_name = strdup(config_name);
+    if (config_name != NULL)
+        settings.config_name = strdup(config_name);
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, &settings);
 }
 #endif
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, &settings);
 }
 #endif