mainloop-test: Fix uninitialized memory access in tests
authorStef Walter <stefw@gnome.org>
Sat, 9 Nov 2013 19:26:31 +0000 (20:26 +0100)
committerStef Walter <stefw@gnome.org>
Mon, 11 Nov 2013 16:35:26 +0000 (17:35 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=711751

tests/mainloop-test.c

index 0ac6942..5d30550 100644 (file)
@@ -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);