mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
Xi: fix length calculation for ValuatorState in QueryDeviceState reply.
The length field needs to include the bytes required for the valuators (INT32) as well. The reply length has the right value and since the valuator state is always last, clients didn't notice the wrong offset. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -147,7 +147,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||
if (v != NULL) {
|
||||
tv = (xValuatorState *) buf;
|
||||
tv->class = ValuatorClass;
|
||||
tv->length = sizeof(xValuatorState);
|
||||
tv->length = sizeof(xValuatorState) + v->numAxes * 4;
|
||||
tv->num_valuators = v->numAxes;
|
||||
tv->mode = v->mode;
|
||||
buf += sizeof(xValuatorState);
|
||||
|
||||
Reference in New Issue
Block a user