[glib] mainloop-test: Fix uninitialized memory access in tests



commit 3e041ce5adde83a44f6f5156c7463157539ddbc4
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 20:26:31 2013 +0100

    mainloop-test: Fix uninitialized memory access in tests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711751

 tests/mainloop-test.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/mainloop-test.c b/tests/mainloop-test.c
index 0ac6942..5d30550 100644
--- a/tests/mainloop-test.c
+++ b/tests/mainloop-test.c
@@ -105,7 +105,7 @@ adder_callback (GIOChannel   *source,
   char buf1[32];
   char buf2[32];
 
-  char result[32];
+  char result[32] = { 0, };
 
   AddrData *addr_data = data;
 
@@ -216,8 +216,8 @@ io_pipe (GIOChannel **channels)
 static void
 do_add (GIOChannel *in, gint a, gint b)
 {
-  char buf1[32];
-  char buf2[32];
+  char buf1[32] = { 0, };
+  char buf2[32] = { 0, };
 
   sprintf (buf1, "%d", a);
   sprintf (buf2, "%d", b);


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