From cb0ab6ae0b3b168368b29ae0fa0f5e319243dedd Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 29 Aug 2025 14:32:39 +0200 Subject: [PATCH] Xi: ProcXIPassiveGrabDevice(): move rpcbuf declaration upwards The code below the `out` label is using the rpcbuf variable, but we have a jump site before the variable is declared. It had been overlooked, because for yet unknown reasons the compiler doesn't complain at all about this. We could assume that it at least moves the stack allocation upwards (always could even happen even on function entry), but we don't know whether the memory is already unitialized. So, to be on safe-side, move the declaration upwards, before the first jump site. Signed-off-by: Enrico Weigelt, metux IT consult --- Xi/xipassivegrab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index f1da0ad0fb..921e53b6ba 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -169,6 +169,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) param.other_devices_mode = stuff->grab_mode; } + x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; + if (stuff->cursor != None) { ret = dixLookupResourceByType(&tmp, stuff->cursor, X11_RESTYPE_CURSOR, client, DixUseAccess); @@ -178,8 +180,6 @@ ProcXIPassiveGrabDevice(ClientPtr client) } } - x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - ret = dixLookupWindow((WindowPtr *) &tmp, stuff->grab_window, client, DixSetAttrAccess);