[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:03:29 UTC 2012
The following commit has been merged in the wheezy branch:
commit 457d46b0de45de3ff22a66c36102522df582a5ad
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue May 1 14:43:46 2012 +0200
kernel32: Fix another overflow in GetModuleFileNameExW.
(cherry picked from commit fd11023e4b44b18af7f9d44b216bcc254fe3b299)
diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c
index c65df18..595594b 100644
--- a/dlls/kernel32/module.c
+++ b/dlls/kernel32/module.c
@@ -1247,18 +1247,20 @@ DWORD WINAPI K32GetModuleFileNameExW(HANDLE process, HMODULE module,
return 0;
len = ldr_module.FullDllName.Length / sizeof(WCHAR);
- if (size <= len)
- {
- len = size;
- size--;
- }
-
if (!ReadProcessMemory(process, ldr_module.FullDllName.Buffer,
- file_name, size * sizeof(WCHAR), NULL))
+ file_name, min( len, size ) * sizeof(WCHAR), NULL))
return 0;
- file_name[size] = 0;
- return len;
+ if (len < size)
+ {
+ file_name[len] = 0;
+ return len;
+ }
+ else
+ {
+ file_name[size - 1] = 0;
+ return size;
+ }
}
/***********************************************************************
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list