]> granicus.if.org Git - apache/commitdiff
Check to make sure that the file name is not NULL before passing it to the
authorBradley Nicholes <bnicholes@apache.org>
Tue, 30 Sep 2003 22:01:34 +0000 (22:01 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Tue, 30 Sep 2003 22:01:34 +0000 (22:01 +0000)
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

modules/proxy/mod_proxy.c

index b903578fadf7b6b7e2b6e085a189f23c68313cf6..41e53fd0d4f2e1dbae6e8c96e7fa7b6fbdfcabd4 100644 (file)
@@ -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 */