Xext/xres: fix client PID value swap in ConstructClientIdValue

value points to the location of the client PID, assign it first before
we swap it. For consistency move the memcpy up too so the copy commands
are all in the same location.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200>
This commit is contained in:
Peter Hutterer 2026-04-17 10:27:42 +10:00 committed by Marge Bot
parent 3c576260f2
commit 281d524e04

View file

@ -508,11 +508,11 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
swapl (&rep.length);
}
memcpy(ptr, &rep, sizeof(rep));
*value = pid;
if (sendClient->swapped) {
swapl (value);
}
memcpy(ptr, &rep, sizeof(rep));
*value = pid;
ctx->resultBytes += sizeof(rep) + sizeof(CARD32);
++ctx->numIds;