[Pkg-privacy-commits] [torsocks] 14/38: Suppress signed/unsigned comparison warnings with justified casts.

Intrigeri intrigeri at moszumanska.debian.org
Thu Jun 23 15:18:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental/master
in repository torsocks.

commit 9b146f3762744c02d7646596e396dda149a0d61e
Author: Taylor R Campbell <campbell+torsocks at mumble.net>
Date:   Tue Jun 16 20:37:12 2015 +0000

    Suppress signed/unsigned comparison warnings with justified casts.
---
 tests/test_fd_passing.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test_fd_passing.c b/tests/test_fd_passing.c
index e5eb10f..70d3fef 100644
--- a/tests/test_fd_passing.c
+++ b/tests/test_fd_passing.c
@@ -137,6 +137,8 @@ static ssize_t recv_unix_sock(int sock, void *buf, size_t len)
 	ssize_t ret = -1;
 	size_t len_last;
 
+	assert(len <= SSIZE_MAX);
+
 	memset(&msg, 0, sizeof(msg));
 
 	iov[0].iov_base = buf;
@@ -150,9 +152,10 @@ static ssize_t recv_unix_sock(int sock, void *buf, size_t len)
 		if (ret > 0) {
 			iov[0].iov_base += ret;
 			iov[0].iov_len -= ret;
-			assert(ret <= len_last);
+			assert((size_t)ret <= len_last);
 		}
-	} while ((ret > 0 && ret < len_last) || (ret < 0 && errno == EINTR));
+	} while ((ret > 0 && (size_t)ret < len_last) ||
+	    (ret < 0 && errno == EINTR));
 	if (ret < 0) {
 		perror("recvmsg");
 	} else if (ret > 0) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torsocks.git



More information about the Pkg-privacy-commits mailing list