You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bn...@apache.org on 2004/04/07 23:43:02 UTC
cvs commit: httpd-2.0/server config.c
bnicholes 2004/04/07 14:43:02
Modified: server config.c
Log:
Don't allocation large buffers on the stack to avoid over-running a fixed length stack when ap_build_cont_config() is called recursively (ie. nested <IfDefine> blocks).
Revision Changes Path
1.174 +7 -1 httpd-2.0/server/config.c
Index: config.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/config.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- config.c 18 Feb 2004 15:44:48 -0000 1.173
+++ config.c 7 Apr 2004 21:43:01 -0000 1.174
@@ -985,10 +985,16 @@
ap_directive_t **curr_parent,
char *orig_directive)
{
- char l[MAX_STRING_LEN];
+ char *l;
char *bracket;
const char *retval;
ap_directive_t *sub_tree = NULL;
+
+ /* Since this function can be called recursively, allocate
+ * the temporary 8k string buffer from the temp_pool rather
+ * than the stack to avoid over-running a fixed length stack.
+ */
+ l = apr_palloc(temp_pool, MAX_STRING_LEN);
bracket = apr_pstrcat(p, orig_directive + 1, ">", NULL);
while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) {