[Spice-devel] [PATCH] client: handling SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST

Alexander Larsson alexl at redhat.com
Wed Mar 31 05:42:12 PDT 2010


On Sun, 2010-03-28 at 18:21 +0300, Yonit Halperin wrote:
> disconnecting from the current host and connecting to the target host.

+    SpiceMsgMainMigrationSwitchHost* migrate = (SpiceMsgMainMigrationSwitchHost*)message->data();
+    char* host = ((char*)migrate) + migrate->host_offset;
+    char* subject = NULL;
+    if (migrate->cert_subject_size) {
+        subject = ((char*)migrate)+ migrate->cert_subject_offset;
+    }

This needs to at least verify that the strings are zero terminated
before creating std::strings from them.

 void RedClient::connect()
 {
+    connect(false);
+}
+
+void RedClient::connect(bool wait_main_disconnect)

Can't you use default argument values here instead of two functions?

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a witless zombie inventor on the hunt for the last specimen of a great 
and near-mythical creature. She's a cynical junkie widow with a knack for 
trouble. They fight crime! 



More information about the Spice-devel mailing list