]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Wed, 27 Sep 2023 06:14:16 +0000 (19:14 +1300)
tools/cachemgr.cc

index 35343b826e785b680c93707a61ad31945527bd09..cebd3cedbe33c05d119ac76cdea74ca8ed4edcf6 100644 (file)
@@ -451,8 +451,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;
     }