]> granicus.if.org Git - apache/commitdiff
Merge r1467765 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 15 Apr 2013 12:42:29 +0000 (12:42 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 15 Apr 2013 12:42:29 +0000 (12:42 +0000)
Fix crash in mod_log_config when logging
request end time for a failed request
(LogFormat contains %{end}t).

The request_config for mod_log_config might
not be initialized.

PR 54828.

Submitted by: rjung
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1467981 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/loggers/mod_log_config.c

diff --git a/STATUS b/STATUS
index aba7423054de2b09eca122b7be11b5b75b4570bc..9b6c7f78e0fc88cf49d20c3f487091dc833c87bf 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -90,12 +90,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_log_config: Fix crash when logging request end time for a failed request.
-     PR 54828
-     trunk patch: http://svn.apache.org/r1467765
-     2.4.x patch: trunk patchs applies
-     +1: rjung, covener, jim
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 31c53db6fb45a07e160be35cdfd72dd7e3eabed9..e1a82041712c0261add4c5cb8aab4cd97ddd0506 100644 (file)
@@ -597,6 +597,10 @@ static apr_time_t get_request_end_time(request_rec *r)
 {
     log_request_state *state = (log_request_state *)ap_get_module_config(r->request_config,
                                                                          &log_config_module);
+    if (!state) {
+        state = apr_pcalloc(r->pool, sizeof(log_request_state));
+        ap_set_module_config(r->request_config, &log_config_module, state);
+    }
     if (state->request_end_time == 0) {
         state->request_end_time = apr_time_now();
     }