mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-06 18:06:26 +00:00
Fixed potential uninitialized memory access (thanks Mathieu!)
GetRawInputDeviceList() can return a different number of devices than was allocated. Fixes https://github.com/libsdl-org/SDL/issues/2759
This commit is contained in:
@@ -132,7 +132,8 @@ static void GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetRawInputDeviceList(devices, &device_count, sizeof(RAWINPUTDEVICELIST)) == -1) {
|
||||
device_count = GetRawInputDeviceList(devices, &device_count, sizeof(RAWINPUTDEVICELIST));
|
||||
if (device_count == (UINT)-1) {
|
||||
SDL_free(devices);
|
||||
return; /* oh well. */
|
||||
}
|
||||
|
Reference in New Issue
Block a user