Module: wine Branch: master Commit: 77432ac45db59440af1aa75e36c93cd025e4e5fc URL: http://source.winehq.org/git/wine.git/?a=commit;h=77432ac45db59440af1aa75e36...
Author: Ken Thomases ken@codeweavers.com Date: Wed Mar 18 14:02:13 2015 -0500
winejoystick: Fix a crash on accessing a CFArray past its end due to an off-by-one error in the Mac code.
---
dlls/winejoystick.drv/joystick_osx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winejoystick.drv/joystick_osx.c b/dlls/winejoystick.drv/joystick_osx.c index c8850af..cb66c47 100644 --- a/dlls/winejoystick.drv/joystick_osx.c +++ b/dlls/winejoystick.drv/joystick_osx.c @@ -528,7 +528,7 @@ static BOOL open_joystick(joystick_t* joystick) }
index = joystick - joysticks; - if (index > CFArrayGetCount(device_main_elements)) + if (index >= CFArrayGetCount(device_main_elements)) return FALSE;
joystick->element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, index);