From: Jeff Trawick Date: Wed, 22 Aug 2001 12:07:40 +0000 (+0000) Subject: Fix a segfault in mod_include when the original request has no X-Git-Tag: 2.0.25~198 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f54292361de3de7fc2615f7646094d4a1a813d4;p=apache Fix a segfault in mod_include when the original request has no associated filename (e.g., we're filtering the error document for a bad URI). Reported by: Joshua Slive git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90486 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 71fa7705b3..67acc9021e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.25-dev + *) Fix a segfault in mod_include when the original request has no + associated filename (e.g., we're filtering the error document for + a bad URI). [Jeff Trawick] + *) Fix a storage leak (a strdup() call) in mod_mime_magic. [Jeff Trawick] *) The prefork and OS/2 MPMs are overwriting the pid file when a second copy diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 0dad620536..b65a50ba10 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -832,8 +832,8 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb, request_r for (p = r; p != NULL && !founddupe; p = p->main) { request_rec *q; for (q = p; q != NULL; q = q->prev) { - if ( (strcmp(q->filename, rr->filename) == 0) || - (strcmp(q->uri, rr->uri) == 0) ){ + if ((q->filename && rr->filename && (strcmp(q->filename, rr->filename) == 0)) || + (strcmp(q->uri, rr->uri) == 0)) { founddupe = 1; break; }