tests/unix: Ensure buffer is NUL terminated
authorColin Walters <walters@verbum.org>
Thu, 21 Jun 2012 19:33:51 +0000 (15:33 -0400)
committerColin Walters <walters@verbum.org>
Fri, 22 Jun 2012 14:32:26 +0000 (10:32 -0400)
glib/tests/unix.c

index 77ee61e..9051ade 100644 (file)
@@ -43,6 +43,7 @@ test_pipe (void)
   memset (buf, 0, sizeof (buf));
   bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
   g_assert_cmpint (bytes_read, >, 0);
+  buf[bytes_read] = '\0';
 
   close (pipefd[0]);
   close (pipefd[1]);