From 89fda5a4410099a317bd1fcef56b130d6d97a2b5 Mon Sep 17 00:00:00 2001 From: dinglimin_yewu Date: Sat, 16 Sep 2023 17:41:07 +0800 Subject: [PATCH] ui: fix crash when there are no active_console MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cherry-pick from 48a35e12faf90a896c5aa4755812201e00d60316 Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812 812 return con->hw_ops->ui_info != NULL; (gdb) bt Fixes: https://issues.redhat.com/browse/RHEL-2600 Signed-off-by: Marc-André Lureau Reviewed-by: Albert Esteve Signed-off-by: dinglimin_yewu --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 29a3e3f0f5..d22c3def20 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1526,6 +1526,9 @@ bool dpy_ui_info_supported(QemuConsole *con) con = active_console; } + if (con == NULL) { + return false; + } return con->hw_ops->ui_info != NULL; } -- 2.41.0.windows.1