From: Amos Jeffries Date: Thu, 21 Sep 2023 17:09:34 +0000 (+0000) Subject: Bug 5300: cachemgr.cgi assertion (#1478) X-Git-Tag: SQUID_6_4~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baae0de8ec0057cdb93deebfe55bcdbfe30a61eb;p=thirdparty%2Fsquid.git Bug 5300: cachemgr.cgi assertion (#1478) --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 3facfc4adf..1008afc38c 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -456,8 +456,11 @@ munge_menu_line(MemBuf &out, const char *buf, cachemgr_request * req) char *a_url; char *buf_copy; - const char bufLen = strlen(buf); - if (bufLen < 1 || *buf != ' ') { + const auto bufLen = strlen(buf); + if (bufLen < 1) + return; // nothing to append + + if (*buf != ' ') { out.append(buf, bufLen); return; }