From: Hugh McMaster Subject: [PATCH] libs/wine/string.c: Prevent a segmentation fault Message-Id: Date: Wed, 17 Dec 2014 21:41:28 +1100 Prevent a segmentation fault when calling vsnprintfW(NULL, , fmt, va_args). From 8b080dc55c918ab47b1cc067696ac019b69174c0 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 17 Dec 2014 20:59:58 +1100 Subject: [PATCH] libs/wine/string.c: Prevent segmentation fault --- libs/wine/string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/wine/string.c b/libs/wine/string.c index f2a9bd3..45a8810 100644 --- a/libs/wine/string.c +++ b/libs/wine/string.c @@ -360,6 +360,9 @@ int vsnprintfW(WCHAR *str, size_t len, const WCHAR *format, va_list valist) const WCHAR *iter = format; char bufa[512], fmtbufa[64], *fmta; + if (!str && len) + return -1; + while (*iter) { while (*iter && *iter != '%') -- 1.9.1