------------------------------------------------------------ revno: 13188 revision-id: squid3@treenet.co.nz-20141113081906-80ipwnow6uscfk8a parent: squid3@treenet.co.nz-20141031092151-saf3j5mija94w0bs committer: Amos Jeffries branch nick: 3.4 timestamp: Thu 2014-11-13 00:19:06 -0800 message: 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. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20141113081906-80ipwnow6uscfk8a # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: e42523cf8f099a75cca9cb9742b0379fa9d715a0 # timestamp: 2014-11-13 08:22:07 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20141031092151-\ # saf3j5mija94w0bs # # Begin patch === modified file 'src/acl/UrlPath.cc' --- src/acl/UrlPath.cc 2013-01-27 17:35:07 +0000 +++ src/acl/UrlPath.cc 2014-11-13 08:19:06 +0000 @@ -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);