Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 12595 invoked from network); 7 Apr 2004 21:43:04 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Apr 2004 21:43:04 -0000 Received: (qmail 64792 invoked by uid 500); 7 Apr 2004 21:42:50 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 64766 invoked by uid 500); 7 Apr 2004 21:42:50 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 64747 invoked by uid 500); 7 Apr 2004 21:42:50 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 64744 invoked from network); 7 Apr 2004 21:42:49 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 7 Apr 2004 21:42:49 -0000 Received: (qmail 12577 invoked by uid 1285); 7 Apr 2004 21:43:02 -0000 Date: 7 Apr 2004 21:43:02 -0000 Message-ID: <20040407214302.12576.qmail@minotaur.apache.org> From: bnicholes@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server config.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 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))) {