--- ./Xext/xres.c.orig 2026-11-10 16:27:17.179365895 -0600 +++ ./Xext/xres.c 2026-11-10 16:29:45.100357326 -0600 @@ -579,6 +579,8 @@ InitConstructClientIdCtx(&ctx); REQUEST_AT_LEAST_SIZE(xXResQueryClientIdsReq); + if (stuff->numSpecs > UINT32_MAX / sizeof(specs[0])) + return BadLength; REQUEST_FIXED_SIZE(xXResQueryClientIdsReq, stuff->numSpecs * sizeof(specs[0])); @@ -1049,6 +1051,8 @@ REQUEST_AT_LEAST_SIZE (xXResQueryClientIdsReq); swapl(&stuff->numSpecs); + if (stuff->numSpecs > UINT32_MAX / sizeof(*specs)) + return BadLength; return ProcXResQueryClientIds(client); }