Module: wine Branch: master Commit: cac02872c6f3d8c286cfdb6201b200a6c5fa24ee URL: https://gitlab.winehq.org/wine/wine/-/commit/cac02872c6f3d8c286cfdb6201b200a...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Feb 13 19:17:57 2023 +0100
winetest: Avoid an infinite loop in vstrfmtmake() when the format is NULL.
When the format is NULL vsnprintf() always returns -1 so we keep doubling the allocated memory until running out of memory.
---
programs/winetest/util.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/programs/winetest/util.c b/programs/winetest/util.c index a1320005841..bd5b584c3c4 100644 --- a/programs/winetest/util.c +++ b/programs/winetest/util.c @@ -56,6 +56,7 @@ static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap) char *p; int n;
+ if (!fmt) fmt = ""; p = xalloc(size); while (1) { n = vsnprintf (p, size, fmt, ap);