]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 5300: cachemgr.cgi assertion (#1478)
authorAmos Jeffries <yadij@users.noreply.github.com>
Thu, 21 Sep 2023 17:09:34 +0000 (17:09 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 22 Sep 2023 15:50:25 +0000 (15:50 +0000)
tools/cachemgr.cc

index 3facfc4adfa0352e49662a91f7c197e1e7477cfe..1008afc38ccc04a88c7182be090aa7e5a1f1e597 100644 (file)
@@ -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;
     }