From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:19:28 +0000 (+0000) Subject: Use AnyP::Uri::Decode() for urllogin checks (#1659) X-Git-Tag: SQUID_7_0_1~217 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=226394f2813b1108649a7330f612e58f53b02dbe;p=thirdparty%2Fsquid.git Use AnyP::Uri::Decode() for urllogin checks (#1659) --- diff --git a/src/acl/UrlLogin.cc b/src/acl/UrlLogin.cc index f56031bac3..df9322c2ec 100644 --- a/src/acl/UrlLogin.cc +++ b/src/acl/UrlLogin.cc @@ -11,8 +11,8 @@ #include "squid.h" #include "acl/FilledChecklist.h" #include "acl/UrlLogin.h" +#include "anyp/Uri.h" #include "HttpRequest.h" -#include "rfc1738.h" int Acl::UrlLoginCheck::match(ACLChecklist * const ch) @@ -24,11 +24,7 @@ Acl::UrlLoginCheck::match(ACLChecklist * const ch) return 0; // nothing can match } - static char str[MAX_URL]; // should be big enough for a single URI segment - - const SBuf::size_type len = checklist->request->url.userInfo().copy(str, sizeof(str)-1); - str[len] = '\0'; - rfc1738_unescape(str); - return data->match(str); + auto decodedUserInfo = AnyP::Uri::Decode(checklist->request->url.userInfo()); + return data->match(decodedUserInfo.c_str()); }