From 2f1f04f7cb521f175a6d4ce45c6a71e9e5d7a370 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 16 Feb 2026 00:55:08 +0000 Subject: [PATCH] Short circuit empty format strings in Anope::Format. This fixes a bug where Anope would loop infinitely when passed an empty format string. --- src/misc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc.cpp b/src/misc.cpp index 26db9ba65..650e5ccc5 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -783,6 +783,9 @@ Anope::string Anope::Format(const char *fmt, ...) Anope::string Anope::Format(va_list &valist, const char *fmt) { + if (!fmt || !fmt[0]) + return ""; + static std::vector buffer(512); while (true) {