]> granicus.if.org Git - apache/commitdiff
Don't allocation large buffers on the stack to avoid over-running a fixed length...
authorBradley Nicholes <bnicholes@apache.org>
Wed, 7 Apr 2004 21:43:01 +0000 (21:43 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 7 Apr 2004 21:43:01 +0000 (21:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103290 13f79535-47bb-0310-9956-ffa450edef68

server/config.c

index d50cfae1a744f8b155b1c5b1ec221e65157c76fa..52ebfbe028add27c342731895907815b8a049386 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)