From: wessels <> Date: Tue, 21 Aug 2001 11:54:13 +0000 (+0000) Subject: Bugzilla #215: NULL pointer access for proxy requests in accel-only mode X-Git-Tag: SQUID_3_0_PRE1~1434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6abc193b4c4359da4b53a31123df9c4929676819;p=thirdparty%2Fsquid.git Bugzilla #215: NULL pointer access for proxy requests in accel-only mode This patch fixes the bug by checking for NULL in aclIsProxyAuth(). If access is denied due to receipt of a proxy request with 'httpd_accel_with_proxy off' then AclMatchedName is NULL. clientAccessCheckDone() calls aclIsProxyAuth() with the NULL pointer, so the check could go into either function. It was cleaner to put it in aclIsProxyAuth(). --- diff --git a/src/acl.cc b/src/acl.cc index fdcc53e3e9..887c87af31 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.257 2001/08/03 16:54:51 wessels Exp $ + * $Id: acl.cc,v 1.258 2001/08/21 05:54:13 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -901,8 +901,10 @@ aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name) int aclIsProxyAuth(const char *name) { - acl *a = aclFindByName(name); - if (a) + acl *a; + if (NULL == name) + return 0; + if ((a = aclFindByName(name))) return a->type == ACL_PROXY_AUTH; return 0; }