From: Francois Gouget fgouget@codeweavers.com
When the format is NULL vsnprintf() always returns -1 so we keep doubling the allocated memory until running out of memory. --- For a while I could reproduce this out of memory condition in about 20% of the runs and determined it probably came from a textOut() call. My main suspects were: report (R_OUT, logname); report (R_DIR, tempdir); These are wrong anyway but for other reasonis. But this issue stopped happening before I could confirm my suspicions or identify the actual caller :-(
Anyway printf(NULL) does not crash (with the glibc it's the same as print("")) so I figure vstrfmtmake() should not either. --- programs/winetest/util.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/programs/winetest/util.c b/programs/winetest/util.c index a1320005841..589810c8fcc 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 = "(noformat)"; p = xalloc(size); while (1) { n = vsnprintf (p, size, fmt, ap);