From 4f75e2f95c5ef327c72ead4a7b0f7bf8c25b56ba Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 3 May 2017 14:42:03 -0400 Subject: utf16_to_utf8: Allocate space for converted string and NUL References #6646 --- src/nvim/mbyte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index b21ec944c1..8a68ce0915 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1367,7 +1367,7 @@ int utf16_to_utf8(const WCHAR *strw, char **str) return GetLastError(); } - *str = xmalloc(utf8_len); + *str = xmallocz(utf8_len); // Convert to UTF-8. utf8_len = WideCharToMultiByte(CP_UTF8, -- cgit