Commit cac02872 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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.
parent b07129ba
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment