]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
log: Follow up to r1908388: ap_server_conf might be NULL.
authorYann Ylavic <ylavic@apache.org>
Tue, 14 Mar 2023 15:43:27 +0000 (15:43 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 14 Mar 2023 15:43:27 +0000 (15:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908390 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index 6beb03a701a2e69731dac90d8b3776eb163ac5f7..2f84635a75245d1a2c04e1a3808a939efac69c3f 100644 (file)
@@ -1100,7 +1100,9 @@ static void log_error_core(const char *file, int line, int module_index,
         }
 
         /* Use the main ErrorLogFormat if any */
-        sconf = ap_get_core_module_config(ap_server_conf->module_config);
+        if (ap_server_conf) {
+            sconf = ap_get_core_module_config(ap_server_conf->module_config);
+        }
     }
     else {
         int configured_level = r ? ap_get_request_module_loglevel(r, module_index)        :
@@ -1148,7 +1150,7 @@ static void log_error_core(const char *file, int line, int module_index,
                 }
             }
         }
-        else {
+        else if (ap_server_conf) {
             /* Use the main ErrorLogFormat if any */
             sconf = ap_get_core_module_config(ap_server_conf->module_config);
         }
@@ -1222,7 +1224,7 @@ static void log_error_core(const char *file, int line, int module_index,
             info.file         = file;
             info.line         = line;
             info.status       = status;
-            log_format = sconf->error_log_format;
+            log_format = sconf ? sconf->error_log_format : NULL;
             done = 1;
         }