If CONF_get_string returns NULL and we want to tolerate this
[openssl.git] / apps / x509.c
index de25790145dad2b8fab18150d7251df9f4af648e..9422e1d15cdef004d915ad272eb5203b5fc3a599 100644 (file)
@@ -498,8 +498,15 @@ bad:
                                                        ,errorline,extfile);
                        goto end;
                        }
                                                        ,errorline,extfile);
                        goto end;
                        }
-               if (!extsect && !(extsect = CONF_get_string(extconf, "default",
-                                        "extensions"))) extsect = "default";
+               if (!extsect)
+                       {
+                       extsect = CONF_get_string(extconf, "default", "extensions");
+                       if (!extsect)
+                               {
+                               ERR_clear_error();
+                               extsect = "default";
+                               }
+                       }
                X509V3_set_ctx_test(&ctx2);
                X509V3_set_conf_lhash(&ctx2, extconf);
                if (!X509V3_EXT_add_conf(extconf, &ctx2, extsect, NULL))
                X509V3_set_ctx_test(&ctx2);
                X509V3_set_conf_lhash(&ctx2, extconf);
                if (!X509V3_EXT_add_conf(extconf, &ctx2, extsect, NULL))