diff --git a/reactos/dll/win32/psapi/psapi.c b/reactos/dll/win32/psapi/psapi.c index 934aeb3694a..1e026ca9993 100644 --- a/reactos/dll/win32/psapi/psapi.c +++ b/reactos/dll/win32/psapi/psapi.c @@ -922,6 +922,12 @@ GetModuleInformation(HANDLE hProcess, DWORD cb) { GET_MODULE_INFORMATION_FLAGS Flags = {FALSE, FALSE, FALSE}; + + if (cb < sizeof(MODULEINFO)) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } return (BOOL)InternalGetModuleInformation(hProcess, hModule, Flags, lpmodinfo, cb); }