dovecot-2.2: lib: Fixed test-istream-unix to not send uninitiali...

dovecot at dovecot.org dovecot at dovecot.org
Sat Apr 25 08:42:00 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/2c5b0ad65885
changeset: 18483:2c5b0ad65885
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Apr 25 11:40:23 2015 +0300
description:
lib: Fixed test-istream-unix to not send uninitialized bytes.
Fixes Valgrind errors in make check.

diffstat:

 src/lib/test-istream-unix.c |  16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 25c848f10517 -r 2c5b0ad65885 src/lib/test-istream-unix.c
--- a/src/lib/test-istream-unix.c	Sat Apr 25 11:27:17 2015 +0300
+++ b/src/lib/test-istream-unix.c	Sat Apr 25 11:40:23 2015 +0300
@@ -115,14 +115,12 @@
 
 static void test_istream_unix_client(int fd)
 {
-	char buf;
-
 	/* 1) */
 	write_one(fd);
 	read_one(fd);
 
 	/* 2) */
-	if (fd_send(fd, send_fd, &buf, 1) < 0)
+	if (fd_send(fd, send_fd, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
 	read_one(fd);
 
@@ -131,7 +129,7 @@
 	read_one(fd);
 
 	/* 4) */
-	if (fd_send(fd, send_fd2, &buf, 1) < 0)
+	if (fd_send(fd, send_fd2, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
 	read_one(fd);
 
@@ -140,21 +138,21 @@
 	read_one(fd);
 
 	/* 6) */
-	if (fd_send(fd, send_fd, &buf, 1) < 0)
+	if (fd_send(fd, send_fd, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
 	read_one(fd);
 
 	/* 7-8) */
-	if (fd_send(fd, send_fd, &buf, 1) < 0)
+	if (fd_send(fd, send_fd, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
-	if (fd_send(fd, send_fd2, &buf, 1) < 0)
+	if (fd_send(fd, send_fd2, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
 	read_one(fd);
 
 	/* 9-10) */
-	if (fd_send(fd, send_fd, &buf, 1) < 0)
+	if (fd_send(fd, send_fd, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
-	if (fd_send(fd, send_fd2, &buf, 1) < 0)
+	if (fd_send(fd, send_fd2, "1", 1) < 0)
 		i_fatal("fd_send() failed: %m");
 	read_one(fd);
 


More information about the dovecot-cvs mailing list