[Pkg-privacy-commits] [torsocks] 13/38: Use size_t, not int, for indices below size_t bounds.

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 80e1ffb565bdd3c41063a743617f17faa81ab9aa
Author: Taylor R Campbell <campbell+torsocks at mumble.net>
Date:   Tue Jun 16 20:33:49 2015 +0000

    Use size_t, not int, for indices below size_t bounds.
---
 src/lib/recv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/recv.c b/src/lib/recv.c
index 1ff1446..d1bbaea 100644
--- a/src/lib/recv.c
+++ b/src/lib/recv.c
@@ -39,7 +39,7 @@ TSOCKS_LIBC_DECL(recvmsg, LIBC_RECVMSG_RET_TYPE, LIBC_RECVMSG_SIG)
  */
 static void close_fds(int *fds, size_t count)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i < count; i++) {
 		tsocks_libc_close(fds[i]);
@@ -124,8 +124,8 @@ LIBC_RECVMSG_RET_TYPE tsocks_recvmsg(LIBC_RECVMSG_SIG)
 		 * chance here of having a crazy high value that could exhaust the
 		 * stack memory.
 		 */
-		size_t sizeof_fds = (cmsg->cmsg_len - sizeof(*cmsg)) / sizeof(int);
-		int i, fds[sizeof_fds];
+		size_t i, sizeof_fds = (cmsg->cmsg_len - sizeof(*cmsg)) / sizeof(int);
+		int fds[sizeof_fds];
 
 		memcpy(&fds, CMSG_DATA(cmsg), sizeof(fds));
 

-- 
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