Skip to contentSkip to conversation

Reverse VNC connections: Avoid segmentation fault.

PATCH New Eddie Kohler 1 participant 1 message Sep 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Reverse VNC connections: Avoid segmentation fault.

Hi

-vnc HOST:PORT,reverse connections are currently broken, because vnc_refresh_server_surface is called before the guest is actually available. The following patch fixes reverse connections.

Eddie

Quoted 1 line

From 32fe1bc61ee9f2f1a8220642a48acb05b5be7322 Mon Sep 17 00:00:00 2001

From: Eddie Kohler <[email protected]>
Date: Wed, 29 Sep 2010 12:00:55 -0700
Subject: [PATCH] Reverse VNC connections: Avoid segmentation fault.

---
 ui/vnc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
ui/vnc.c +4 -0
index c7a1831..8c3af8a 100644
@@ -2261,6 +2261,10 @@ static int vnc_refresh_server_surface(VncDisplay *vd)
     VncState *vs;
     int has_dirty = 0;
 
+    /* On reverse connections, the guest might not be connected yet. */
+    if (!vd->guest.ds)
+       return 0;
+
     /*
      * Walk through the guest dirty map.
      * Check and copy modified bits from guest to server surface.
Signature · 1 line
1.7.0.4