------------------------------------------------------------ revno: 13659 revision-id: squid3@treenet.co.nz-20141113080305-28jq6ulz41wt9mmc parent: squid3@treenet.co.nz-20141113080158-kic511y050sgnkfa committer: Amos Jeffries branch nick: 3.5 timestamp: Thu 2014-11-13 00:03:05 -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-20141113080305-28jq6ulz41wt9mmc # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 98604ae3d48b901c69e6cb5a060bb854110bc87c # timestamp: 2014-11-13 08:04:42 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20141113080158-\ # kic511y050sgnkfa # # Begin patch === modified file 'src/acl/UrlPath.cc' --- src/acl/UrlPath.cc 2014-09-13 13:59:43 +0000 +++ src/acl/UrlPath.cc 2014-11-13 08:03:05 +0000 @@ -18,6 +18,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);