mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-08 04:38:22 +02:00
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:
parent
66bdc51b1c
commit
b243ef9bc2
1 changed files with 20 additions and 0 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue