Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ui: return NULL when getting cursor without a console
VNC may try to get the current cursor even when there are no consoles
and crashes. Simple reproducer is qemu with -nodefaults.

Fixes: (again)
https://gitlab.com/qemu-project/qemu/-/issues/1548

Fixes: commit 385ac97 ("ui: keep current cursor with QemuConsole")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230428154807.2143652-1-marcandre.lureau@redhat.com>
(cherry picked from commit 333e759)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
elmarco authored and Michael Tokarev committed Jun 28, 2023
1 parent aab37b2 commit dc4c852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/console.c
Expand Up @@ -2306,7 +2306,7 @@ QEMUCursor *qemu_console_get_cursor(QemuConsole *con)
if (con == NULL) {
con = active_console;
}
return con->cursor;
return con ? con->cursor : NULL;
}

bool qemu_console_is_visible(QemuConsole *con)
Expand Down

0 comments on commit dc4c852

Please sign in to comment.