Skip to content

Commit d479dbb

Browse files
committed
Close PR 50861 where enabling and disabling of buffered
logs can cause a segfault. Patch by: Torsten Förtsch <torsten.foertsch@gmx.net> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082518 13f79535-47bb-0310-9956-ffa450edef68
1 parent 2656af1 commit d479dbb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changes with Apache 2.3.12
44

5+
*) mod_log_config: Prevent segfault. PR 50861. [Torsten Förtsch
6+
<torsten.foertsch gmx.net>]
7+
58
*) core: AllowEncodedSlashes new option NoDecode to allow encoded slashes
69
in request URL path info but not decode them. Change behavior of option
710
"On" to decode the encoded slashes as 2.0 and 2.2 do. PR 35256,

modules/loggers/mod_log_config.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,10 @@ static const char *set_buffered_logs_on(cmd_parms *parms, void *dummy, int flag)
12951295
ap_log_set_writer_init(ap_buffered_log_writer_init);
12961296
ap_log_set_writer(ap_buffered_log_writer);
12971297
}
1298+
else {
1299+
ap_log_set_writer_init(ap_default_log_writer_init);
1300+
ap_log_set_writer(ap_default_log_writer);
1301+
}
12981302
return NULL;
12991303
}
13001304
static const command_rec config_log_cmds[] =
@@ -1668,6 +1672,11 @@ static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
16681672
log_pfn_register(p, "R", log_handler, 1);
16691673
}
16701674

1675+
/* reset to default conditions */
1676+
ap_log_set_writer_init(ap_default_log_writer_init);
1677+
ap_log_set_writer(ap_default_log_writer);
1678+
buffered_logs = 0;
1679+
16711680
return OK;
16721681
}
16731682

0 commit comments

Comments
 (0)