From 281d524e043fcffd78050eb6f0d8d00869c9d662 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Apr 2026 10:27:42 +1000 Subject: [PATCH] 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: --- Xext/xres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/xres.c b/Xext/xres.c index 9c215aeec..85dbd5d1a 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -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;