[Spice-devel] [PATCH spice-gtk 2/2] session: take pubkey reference in setter

Marc-André Lureau marcandre.lureau at gmail.com
Thu Mar 29 12:32:18 PDT 2012


The session assumed it owned a reference to it.
But it didn't get it, and that lead to invalid memory access.
---
 gtk/spice-session.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index ea1a0f3..d30d089 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -476,7 +476,7 @@ static void spice_session_set_property(GObject      *gobject,
     case PROP_PUBKEY:
         if (s->pubkey)
             g_byte_array_unref(s->pubkey);
-        s->pubkey = g_value_get_boxed(value);
+        s->pubkey = g_value_dup_boxed(value);
         if (s->pubkey)
             s->verify = SPICE_SESSION_VERIFY_PUBKEY;
 	break;
-- 
1.7.7.6



More information about the Spice-devel mailing list