[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:
Peter Johnson
2023-01-31 23:40:22 -08:00
committed by GitHub
parent 4054893669
commit 83ef8f9658

View File

@@ -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;