Xi: Swap property data in SProcXChangeDeviceProperty/SProcXIChangeProperty

Both SProcXChangeDeviceProperty() and SProcXIChangeProperty() swap the
fixed header fields (property, type, nUnits/num_items) but fail to
byte-swap the variable-length property data (CARD16 or CARD32, depending
on format) that follows the header.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2202>
This commit is contained in:
Peter Hutterer 2026-04-18 09:03:55 +10:00
parent 66bdc51b1c
commit b243ef9bc2

View file

@ -1022,6 +1022,16 @@ SProcXChangeDeviceProperty(ClientPtr client)
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->nUnits);
switch (stuff->format) {
case 8:
break;
case 16:
SwapRestS(stuff);
break;
case 32:
SwapRestL(stuff);
break;
}
return (ProcXChangeDeviceProperty(client));
}
@ -1262,6 +1272,16 @@ SProcXIChangeProperty(ClientPtr client)
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->num_items);
switch (stuff->format) {
case 8:
break;
case 16:
SwapRestS(stuff);
break;
case 32:
SwapRestL(stuff);
break;
}
return (ProcXIChangeProperty(client));
}