From baae0de8ec0057cdb93deebfe55bcdbfe30a61eb Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 21 Sep 2023 17:09:34 +0000 Subject: [PATCH] Bug 5300: cachemgr.cgi assertion (#1478) --- tools/cachemgr.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.47.2