qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui: return NULL when getting cursor without a console
@ 2023-04-28 15:48 marcandre.lureau
  2023-04-28 18:03 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: marcandre.lureau @ 2023-04-28 15:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, Marc-André Lureau, Gerd Hoffmann

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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 385ac97f8 ("ui: keep current cursor with QemuConsole")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/console.c b/ui/console.c
index cbd60cc473..aefa43a1a4 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2341,7 +2341,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)
-- 
2.40.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui: return NULL when getting cursor without a console
  2023-04-28 15:48 [PATCH] ui: return NULL when getting cursor without a console marcandre.lureau
@ 2023-04-28 18:03 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-04-28 18:03 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: qemu-stable, Gerd Hoffmann

On 28/4/23 17:48, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> 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 385ac97f8 ("ui: keep current cursor with QemuConsole")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   ui/console.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-28 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-28 15:48 [PATCH] ui: return NULL when getting cursor without a console marcandre.lureau
2023-04-28 18:03 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).