spice: monitors_config: check pointer before dereferencing
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 7 Apr 2014 10:15:44 +0000 (12:15 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 7 Apr 2014 10:18:43 +0000 (12:18 +0200)
Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-display.c

index e28698c6b6b28caa82a825fc4e30a19b57cce773..ce6b220f5593bdb9766cb4fd5c239dfd82b8dd51 100644 (file)
@@ -549,6 +549,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
     QemuUIInfo info;
     int rc;
 
+    if (!mc) {
+        return 1;
+    }
+
     /*
      * FIXME: multihead is tricky due to the way
      * spice has multihead implemented.