[glib-networking/mcatanzaro/base-rebase: 12/38] base: Fix uninitialized memory use on cancellation



commit fb43ff9067c62c1520f59cf351099ac426991d34
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Apr 4 22:27:24 2019 -0500

    base: Fix uninitialized memory use on cancellation
    
    Port of eb24905fece641194bad91e8fe6e073dd324023a

 tls/base/gtlsconnection-base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index f94341b..4353694 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -403,7 +403,7 @@ claim_op (GTlsConnectionBase    *tls,
       GPollFD fds[2];
       int nfds;
       gint64 start_time;
-      gint result;
+      gint result = 1; /* if the loop is never entered, it's as if we cancelled early */
 
       g_cancellable_reset (tls->waiting_for_op);
 
@@ -920,7 +920,7 @@ g_tls_connection_base_condition_wait (GDatagramBased  *datagram_based,
   GTlsConnectionBase *tls = G_TLS_CONNECTION_BASE (datagram_based);
   GPollFD fds[2];
   guint n_fds;
-  gint result;
+  gint result = 1; /* if the loop is never entered, it's as if we cancelled early */
   gint64 start_time;
 
   if (g_cancellable_set_error_if_cancelled (cancellable, error))


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