Commit 77432ac4 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winejoystick: Fix a crash on accessing a CFArray past its end due to an…

winejoystick: Fix a crash on accessing a CFArray past its end due to an off-by-one error in the Mac code.
parent 40d806dc
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment