From 77432ac45db59440af1aa75e36c93cd025e4e5fc Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 18 Mar 2015 14:02:13 -0500 Subject: [PATCH] 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 c8850af9df9..cb66c47f8dc 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);