From cfcb69b94d6c6a08431e5ac8a092cb3c4039f387 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 15 Apr 2013 12:42:29 +0000 Subject: [PATCH] Merge r1467765 from trunk: 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 | 6 ------ modules/loggers/mod_log_config.c | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index aba7423054..9b6c7f78e0 100644 --- 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 ] diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 31c53db6fb..e1a8204171 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -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(); } -- 2.50.1