[glib: 1/11] gbufferedoutputstream: Fix jump conditional on uninitialised data



commit c1d8b9c806427f75c4707e1634d2e2565b6fe733
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jun 27 09:51:12 2018 +0100

    gbufferedoutputstream: Fix jump conditional on uninitialised data
    
    The flush data structures were not zero-initialised, which meant the
    branch in flush_buffer_thread() was based on an uninitialised condition.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gio/gbufferedoutputstream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gbufferedoutputstream.c b/gio/gbufferedoutputstream.c
index 8b2bcdc04..98bda501d 100644
--- a/gio/gbufferedoutputstream.c
+++ b/gio/gbufferedoutputstream.c
@@ -699,7 +699,7 @@ g_buffered_output_stream_flush_async (GOutputStream        *stream,
   GTask *task;
   FlushData *fdata;
 
-  fdata = g_slice_new (FlushData);
+  fdata = g_slice_new0 (FlushData);
   fdata->flush_stream = TRUE;
   fdata->close_stream = FALSE;
 
@@ -732,7 +732,7 @@ g_buffered_output_stream_close_async (GOutputStream        *stream,
   GTask *task;
   FlushData *fdata;
 
-  fdata = g_slice_new (FlushData);
+  fdata = g_slice_new0 (FlushData);
   fdata->close_stream = TRUE;
 
   task = g_task_new (stream, cancellable, callback, data);


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