From: Amos Jeffries Date: Thu, 13 Nov 2014 08:19:06 +0000 (-0800) Subject: Fix segmentation fault in ACLUrlPathStrategy::match X-Git-Tag: SQUID_3_4_10~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5ef8fb2c154eed3d4fab17c7f181fad93ef5748;p=thirdparty%2Fsquid.git Fix segmentation fault in ACLUrlPathStrategy::match CONNECT requests do not contain a path segment. If tested with a urlpath_regex ACL will crash Squid via xstrdup() NULL protection. --- diff --git a/src/acl/UrlPath.cc b/src/acl/UrlPath.cc index 018e20bbc5..8d17ae84ba 100644 --- a/src/acl/UrlPath.cc +++ b/src/acl/UrlPath.cc @@ -42,6 +42,9 @@ int ACLUrlPathStrategy::match (ACLData * &data, ACLFilledChecklist *checklist, ACLFlags &) { + if (!checklist->request->urlpath.size()) + return -1; + char *esc_buf = xstrdup(checklist->request->urlpath.termedBuf()); rfc1738_unescape(esc_buf); int result = data->match(esc_buf);