[glib/wip/gcleanup: 38/79] mainloop-test: Fix uninitialized memory access in tests



commit 6c3c468fbcc33f0ad3d7137803d62e575b4d3ef6
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 14245b7..7e5d4de 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;
 
@@ -215,8 +215,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]