From e47b0557691d2d4b17c58d7e9701402b9314396c Mon Sep 17 00:00:00 2001 From: Michael Dopheide Date: Thu, 17 Nov 2022 21:38:08 +0000 Subject: [PATCH] Fix logic error in vfmt() when growing the buffer --- src/util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cc b/src/util.cc index 52b99e913d..a28bf4a78f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1630,7 +1630,7 @@ const char* vfmt(const char* format, va_list al) va_copy(alc, al); int n = vsnprintf(buf, buf_len, format, al); - if ( n > 0 && buf_len < n ) + if ( n > 0 && buf_len <= n ) { // Not enough room, grow the buffer. buf_len = n + 32; buf = (char*)safe_realloc(buf, buf_len);