From f7b5749315445334029a3e0dc953bd2646ee694b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Apr 2026 12:03:27 +1000 Subject: [PATCH] Xext/xres: add missing byte-swap of spec entries in SProcXResQueryClientIds SProcXResQueryClientIds() swapped the numSpecs field but did not swap the individual xXResClientIdSpec entries that follow the request header. Each spec contains two CARD32 fields: client (an XID) and mask (a bitmask selecting which client ID types to query). Co-Authored-by: Claude Code Part-of: --- Xext/xres.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Xext/xres.c b/Xext/xres.c index 72f49a5cb..5ae91a5dd 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -1047,10 +1047,22 @@ SProcXResQueryClientPixmapBytes(ClientPtr client) static int _X_COLD SProcXResQueryClientIds (ClientPtr client) { + int i; + xXResClientIdSpec *specs; + REQUEST(xXResQueryClientIdsReq); REQUEST_AT_LEAST_SIZE (xXResQueryClientIdsReq); swapl(&stuff->numSpecs); + REQUEST_FIXED_SIZE(xXResQueryClientIdsReq, + stuff->numSpecs * sizeof(xXResClientIdSpec)); + + specs = (xXResClientIdSpec *) (stuff + 1); + for (i = 0; i < stuff->numSpecs; i++) { + swapl(&specs[i].client); + swapl(&specs[i].mask); + } + return ProcXResQueryClientIds(client); }