From 53581bba3ee20671e6e5ab7c743bfbf6ffbe6974 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 30 Mar 2021 21:05:48 -0700 Subject: Note ABI of XResQueryClientIds XResQueryClientIds is now documented to return an array of 32-bit values, not an array of longs. The previous implementation allocated space for 32-bit values but read longs into that, overflowing the array. Applications using this were expecting 32-bit values. This "worked" on little endian 64-bit systems because only one value was typically provided and the low 32-bits got stuck in the right place, although the allocation was overrun at the end. That might cause trouble if the allocator is checking carefully. Signed-off-by: Keith Packard --- include/X11/extensions/XRes.h | 1 + src/XRes.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/X11/extensions/XRes.h b/include/X11/extensions/XRes.h index 1c81616..bedf625 100644 --- a/include/X11/extensions/XRes.h +++ b/include/X11/extensions/XRes.h @@ -98,6 +98,7 @@ Status XResQueryClientPixmapBytes ( /* v1.2 */ +/* Returns an array of uint32_t values, not an array of long */ Status XResQueryClientIds ( Display *dpy, long num_specs, diff --git a/src/XRes.c b/src/XRes.c index 90e72c9..10f166e 100644 --- a/src/XRes.c +++ b/src/XRes.c @@ -261,6 +261,7 @@ static Bool ReadClientValues( return True; } +/* Returns an array of uint32_t values, not an array of long */ Status XResQueryClientIds ( Display *dpy, long num_specs, -- cgit v1.2.1