From d2d4fb35e798fa2be1b0ed82f222cc56589859fc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Apr 2026 12:03:59 +1000 Subject: [PATCH] Xext/xres: fix wrong swap check The byte-swap check for rep.spec.client used 'client->swapped' (the queried client) instead of 'sendClient->swapped' (the requesting client). The reply is sent to sendClient, so swapping must be based on sendClient's byte order. When a byte-swapped client queries a native-byte-order client (or vice versa), the spec.client field in the reply has the wrong byte order, causing the client library to misinterpret the XID. Lines 504 and later correctly use sendClient->swapped, so this was an oversight. Co-Authored-by: Claude Code Part-of: --- Xext/xres.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/xres.c b/Xext/xres.c index 5ae91a5dd..96d5eba7c 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -462,7 +462,7 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask, xXResClientIdValue rep; rep.spec.client = client->clientAsMask; - if (client->swapped) { + if (sendClient->swapped) { swapl (&rep.spec.client); }