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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-29 14:32:39 +02:00
parent 0075fca5fb
commit cb0ab6ae0b

View File

@@ -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);