From 5043f42f36b49e7702d0c496dd4fe157788d44ee Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jun 2009 12:31:40 +1000 Subject: Xi: correct return buffer size for XIGetSelectedEvents. The maximum number of bytes is calculated by the mask len, and the mask len is always in 4-byte units. XI2MASKSIZE however is in bytes. Signed-off-by: Peter Hutterer --- Xi/xiselectev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Xi') diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index cafb97641..f2c6b9a04 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -202,7 +202,7 @@ ProcXIGetSelectedEvents(ClientPtr client) return Success; } - buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + XI2MASKSIZE); + buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + ((XI2MASKSIZE + 3)/4) * 4); if (!buffer) return BadAlloc; -- cgit v1.2.3