From: Bradley Nicholes Date: Tue, 30 Sep 2003 22:01:34 +0000 (+0000) Subject: Check to make sure that the file name is not NULL before passing it to the X-Git-Tag: pre_ajp_proxy~1126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3a7a2686d5d7f38e9ac04b8aac2b45a4a2b138d;p=apache Check to make sure that the file name is not NULL before passing it to the strncmp() function. At least on NetWare this prevents the strncmp() function from faulting and also brings the code into sync with similar checks for a NULL file name before calling strncmp() in other areas of this file. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101361 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index b903578fad..41e53fd0d4 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 */