[3/6] winmm: The dwSize paramater of JOYINFOEX must be set correctly
Bruno Jesus
00cpxxx at gmail.com
Wed Dec 10 22:53:48 CST 2014
-------------- next part --------------
diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c
index 9c06fc2..f4870fe 100644
--- a/dlls/winmm/joystick.c
+++ b/dlls/winmm/joystick.c
@@ -220,7 +220,7 @@ MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo)
TRACE("(%d, %p);\n", wID, lpInfo);
if (!lpInfo) return MMSYSERR_INVALPARAM;
- if (wID >= MAXJOYSTICK) return JOYERR_PARMS;
+ if (wID >= MAXJOYSTICK || lpInfo->dwSize < sizeof(JOYINFOEX)) return JOYERR_PARMS;
if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER;
lpInfo->dwXpos = 0;
More information about the wine-patches
mailing list