[glib-networking] gnutls: fix an async handshake crash



commit 51938b5e9771095f1d0feb1cab3e6d402ca7f6da
Author: Dan Winship <danw gnome org>
Date:   Thu Jan 26 07:56:51 2012 -0500

    gnutls: fix an async handshake crash
    
    g_tls_connection_gnutls_handshake_async() would cause a crash if the
    handshake either succeeded or failed immediately (rather than getting
    an EAGAIN after making partial progress).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658771

 tls/gnutls/gtlsconnection-gnutls.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index f1655d6..4bed055 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -969,6 +969,7 @@ g_tls_connection_gnutls_handshake_async (GTlsConnection       *conn,
       g_simple_async_result_set_op_res_gboolean (simple, TRUE);
       g_simple_async_result_complete_in_idle (simple);
       g_object_unref (simple);
+      return;
     }
   else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
     {
@@ -976,6 +977,7 @@ g_tls_connection_gnutls_handshake_async (GTlsConnection       *conn,
       g_error_free (error);
       g_simple_async_result_complete_in_idle (simple);
       g_object_unref (simple);
+      return;
     }
   else if (error)
     g_error_free (error);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]