From: Bradley Nicholes Date: Wed, 1 Oct 2003 17:10:48 +0000 (+0000) Subject: Check to make sure that there is a file name before sending it to strncmp(). This X-Git-Tag: 2.0.48~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d86ec53a86cf66a8ecfa4c955f32f508fae7113;p=thirdparty%2Fapache%2Fhttpd.git Check to make sure that there is a file name before sending it to strncmp(). This fixes a page fault on NetWare when using mod_proxy with mod_cache. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101365 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index b903578fadf..41e53fd0d4f 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -275,7 +275,7 @@ static int proxy_fixup(request_rec *r) char *url, *p; int access_status; - if (!r->proxyreq || strncmp(r->filename, "proxy:", 6) != 0) + if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0) return DECLINED; /* XXX: Shouldn't we try this before we run the proxy_walk? */ @@ -351,7 +351,7 @@ static int proxy_handler(request_rec *r) long maxfwd; /* is this for us? */ - if (!r->proxyreq || strncmp(r->filename, "proxy:", 6) != 0) + if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0) return DECLINED; /* handle max-forwards / OPTIONS / TRACE */