[Spice-devel] [PATCH] server/inputs_channel: fix test_display_no_ssl segfault on client disconnect when keyboard never initialized

Frediano Ziglio fziglio at redhat.com
Tue Aug 11 12:48:03 PDT 2015


From: Alon Levy <alon at pobox.com>

---
 server/inputs_channel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index b0ba1d6..99e82ae 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -483,7 +483,12 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
 static void inputs_release_keys(void)
 {
     int i;
-    SpiceKbdState *st = keyboard->st;
+    SpiceKbdState *st;
+    
+    if (!keyboard) {
+        return;
+    }
+    st = keyboard->st;
 
     for (i = 0; i < SPICE_N_ELEMENTS(st->key); i++) {
         if (!st->key[i])
-- 
2.1.0



More information about the Spice-devel mailing list