Return-Path: Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 82804 invoked by uid 500); 30 Aug 2001 11:44:03 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 82795 invoked from network); 30 Aug 2001 11:44:02 -0000 Received: from icarus.apache.org (64.125.133.21) by daedalus.apache.org with SMTP; 30 Aug 2001 11:44:02 -0000 Received: (qmail 56644 invoked by uid 1121); 30 Aug 2001 11:42:59 -0000 Date: 30 Aug 2001 11:42:59 -0000 Message-ID: <20010830114259.56643.qmail@icarus.apache.org> From: trawick@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server core.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: X-UID: 615 trawick 01/08/30 04:42:59 Modified: server core.c Log: fix an endless loop (well, until you run out of storage from tiny apr_pstrdup() calls and your machine crashes) when you have a filter chain ap_getword() returns an empty string, not a NULL string, when there are no more words fix a segfault when you don't have a filter chain ap_getword() does not check for a NULL string to search Revision Changes Path 1.56 +8 -4 httpd-2.0/server/core.c Index: core.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/core.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- core.c 2001/08/30 08:26:08 1.55 +++ core.c 2001/08/30 11:42:59 1.56 @@ -3358,13 +3358,17 @@ &core_module); const char *filter, *filters = conf->output_filters; - while ((filter = ap_getword(r->pool, &filters, ';'))) { - ap_add_output_filter(filter, NULL, r, r->connection); + if (filters) { + while ((filter = ap_getword(r->pool, &filters, ';')) && filter[0]) { + ap_add_output_filter(filter, NULL, r, r->connection); + } } filters = conf->input_filters; - while ((filter = ap_getword(r->pool, &filters, ';'))) { - ap_add_input_filter(filter, NULL, r, r->connection); + if (filters) { + while ((filter = ap_getword(r->pool, &filters, ';')) && filter[0]) { + ap_add_input_filter(filter, NULL, r, r->connection); + } } }