From 06801174931a4ee5e4736145c4c164efc06be517 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 16 Jul 2025 05:42:58 +0200 Subject: [PATCH] Xi: ProcXGetSelectedExtensionEvents(): protect from allocation failure If allocation fails, bail out with BadAlloc, instead of segfault. Signed-off-by: Enrico Weigelt, metux IT consult --- Xi/getselev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xi/getselev.c b/Xi/getselev.c index 73d71d5bcd..8941c21874 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -128,6 +128,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) sizeof(XEventClass); rep.length = bytes_to_int32(total_length); buf = calloc(1, total_length); + if (!buf) + return BadAlloc; tclient = buf; aclient = buf + rep.this_client_count;