From f1263be6b7f19da4e16be8c196c8b3bfe0947d83 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 16 Jul 2025 04:58:13 +0200 Subject: [PATCH] xcmisc: consolidate (S)ProcXCMiscGetXIDList() Move conditional swapping of request fields into main request handler, no extra swapped handler needed anymore. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xcmisc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c index defdd0c862..49f60b4665 100644 --- a/Xext/xcmisc.c +++ b/Xext/xcmisc.c @@ -102,6 +102,9 @@ ProcXCMiscGetXIDList(ClientPtr client) REQUEST(xXCMiscGetXIDListReq); REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); + if (client->swapped) + swapl(&stuff->count); + if (stuff->count > UINT32_MAX / sizeof(XID)) return BadAlloc; @@ -153,16 +156,6 @@ ProcXCMiscDispatch(ClientPtr client) } } -static int _X_COLD -SProcXCMiscGetXIDList(ClientPtr client) -{ - REQUEST(xXCMiscGetXIDListReq); - REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); - - swapl(&stuff->count); - return ProcXCMiscGetXIDList(client); -} - static int _X_COLD SProcXCMiscDispatch(ClientPtr client) { @@ -173,7 +166,7 @@ SProcXCMiscDispatch(ClientPtr client) case X_XCMiscGetXIDRange: return ProcXCMiscGetXIDRange(client); case X_XCMiscGetXIDList: - return SProcXCMiscGetXIDList(client); + return ProcXCMiscGetXIDList(client); default: return BadRequest; }