[PATCH] fix spice-server segfault on migration

Gerd Hoffmann kraxel at redhat.com
Tue Feb 15 02:26:49 PST 2011


spice-server tries to use the migration information without checking
whenever this is available in the first place ...

Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 server/reds.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index b8ac79b..b5a81dc 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2403,12 +2403,17 @@ static void reds_mig_finished(int completed)
 
 void reds_mig_switch(void)
 {
+    if (reds->mig_spice == NULL) {
+        return;
+    }
     main_channel_push_migrate_switch(reds->main_channel);
 }
 
 void reds_fill_mig_switch(SpiceMsgMainMigrationSwitchHost *migrate)
 {
     RedsMigSpice *s = reds->mig_spice;
+
+    ASSERT(s != NULL);
     migrate->port = s->port;
     migrate->sport = s->sport;
     migrate->host_size = strlen(s->host) + 1;
-- 
1.7.1


--------------020304040201070108040405--


More information about the Spice-devel mailing list