mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[simulation] GUI: Fix buffer overflow in joystick axes copy (#5036)
This was using an incorrect sizeof which would copy excessive data and overwrite the button data.
This commit is contained in:
@@ -487,7 +487,7 @@ void GlfwSystemJoystick::GetData(HALJoystickData* data, bool mapGamepad) const {
|
||||
}
|
||||
} else {
|
||||
std::memcpy(data->axes.axes, sysAxes,
|
||||
data->axes.count * sizeof(&data->axes.axes[0]));
|
||||
data->axes.count * sizeof(data->axes.axes[0]));
|
||||
}
|
||||
|
||||
data->povs.count = data->desc.povCount;
|
||||
|
||||
Reference in New Issue
Block a user