]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Don't allocation large buffers on the stack to avoid over-running a fixed length...
authorBradley Nicholes <bnicholes@apache.org>
Mon, 12 Apr 2004 21:34:18 +0000 (21:34 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Mon, 12 Apr 2004 21:34:18 +0000 (21:34 +0000)
Reviewed by: bnicholes, nd, trawick

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

STATUS
server/config.c

diff --git a/STATUS b/STATUS
index 64c5133c5e4814d0ee5744c8076aa4fbd7869298..bee02761ba3f4d6a9a7d11091428e01f61fcbd27 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/04/12 21:26:25 $]
+Last modified at [$Date: 2004/04/12 21:34:18 $]
 
 Release:
 
@@ -115,13 +115,6 @@ PATCHES TO BACKPORT FROM 2.1
          http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/core.c?r1=1.272&r2=1.273
        +1: nd (geoff)
 
-    *) Nested <IfDefine> blocks will cause ap_build_cont_config()
-       to 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.
-         server/config.c: r1.174
-       +1: bnicholes, nd, trawick
-
     *) Fix segfault in mod_expires. PR 28047
          modules/metadata/mod_expires.c: r1.54
        +1: nd, bnicholes, trawick
index b99776a059a04bf96715b20f33dbab26ead043b4..1ff94d54f57819d41fa986db01211d436e30d4a2 100644 (file)
@@ -985,11 +985,17 @@ AP_DECLARE(const char *) ap_build_cont_config(apr_pool_t *p,
                                               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))) {
         if (!memcmp(l, "</", 2)