mirror of
https://github.com/anope/anope.git
synced 2026-06-12 17:04:47 +02:00
Short circuit empty format strings in Anope::Format.
This fixes a bug where Anope would loop infinitely when passed an empty format string.
This commit is contained in:
@@ -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<char> buffer(512);
|
||||
while (true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user