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.
This commit is contained in:
Francois Gouget 2023-02-13 19:17:57 +01:00 committed by Alexandre Julliard
parent b07129bad4
commit cac02872c6

View file

@ -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);