From: Jeff Trawick Date: Thu, 30 Aug 2001 11:42:59 +0000 (+0000) Subject: fix an endless loop (well, until you run out of storage from X-Git-Tag: 2.0.26~382 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5daa97d465d716e120d42b5db9cab20c91e3382;p=apache 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90810 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index 1bcc30b0ef..044a11d8c0 100644 --- a/server/core.c +++ b/server/core.c @@ -3358,13 +3358,17 @@ static void core_insert_filter(request_rec *r) &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); + } } }