From ae49b84ee0f6f199b91029f03cf6798a0469091a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 5 May 2013 00:19:11 -0500 Subject: [PATCH] win32_wglob(): Fix too-short malloc of filename buffers --- programs/imagex-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/imagex-win32.c b/programs/imagex-win32.c index 0fe04399..ca347816 100644 --- a/programs/imagex-win32.c +++ b/programs/imagex-win32.c @@ -81,7 +81,7 @@ win32_wglob(const wchar_t *pattern, int flags, size_t filename_len = wcslen(dat.cFileName); size_t len_needed = prefix_len + filename_len; - path = malloc(len_needed + sizeof(wchar_t)); + path = malloc((len_needed + 1) * sizeof(wchar_t)); if (!path) goto oom; -- 2.43.0