Commit b84a4aa5 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

xinput: Check for NULL argument in XInputGetState.

parent b03a4b89
......@@ -126,6 +126,9 @@ static void test_get_state(void)
}
}
result = pXInputGetState(0, NULL);
ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
result = pXInputGetState(XUSER_MAX_COUNT, &state);
ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
......
......@@ -88,6 +88,9 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION* vib
* XInputGetState() in the hook, so we need a wrapper. */
static DWORD xinput_get_state(DWORD index, XINPUT_STATE *state)
{
if (!state)
return ERROR_BAD_ARGUMENTS;
HID_find_gamepads(controllers);
if (index >= XUSER_MAX_COUNT)
......
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