From: Eric Biggers Date: Sun, 5 May 2013 05:19:11 +0000 (-0500) Subject: win32_wglob(): Fix too-short malloc of filename buffers X-Git-Tag: v1.4.0~120 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=ae49b84ee0f6f199b91029f03cf6798a0469091a win32_wglob(): Fix too-short malloc of filename buffers --- 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;