From: Amos Jeffries Date: Tue, 11 Nov 2014 04:55:56 +0000 (-0800) Subject: Fix segmentation fault in ACLUrlPathStrategy::match X-Git-Tag: merge-candidate-3-v1~495 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e56b60231b7b60d11974075e85c45bb36411174;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 e9cdec1c69..8a863516d9 100644 --- a/src/acl/UrlPath.cc +++ b/src/acl/UrlPath.cc @@ -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);