Commit 798b7e60 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

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
parent 09960a53
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -3358,15 +3358,19 @@ static void core_insert_filter(request_rec *r)
						   &core_module); 
    const char *filter, *filters = conf->output_filters;

    while ((filter = ap_getword(r->pool, &filters, ';'))) {
    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, ';'))) {
    if (filters) {
        while ((filter = ap_getword(r->pool, &filters, ';')) && filter[0]) {
            ap_add_input_filter(filter, NULL, r, r->connection);
        }
    }
}

static int core_create_req(request_rec *r)
{