[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torsocks/master] Fix: set addr len for getsockname in accept



commit 76fcebb963d9a590bd387949e600b9a4adfe46b0
Author: David Goulet <dgoulet@xxxxxxxxx>
Date:   Mon Mar 17 14:46:07 2014 -0400

    Fix: set addr len for getsockname in accept
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxx>
---
 src/lib/accept.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/accept.c b/src/lib/accept.c
index 08fe1b4..e9bc36c 100644
--- a/src/lib/accept.c
+++ b/src/lib/accept.c
@@ -42,6 +42,8 @@ LIBC_ACCEPT_RET_TYPE tsocks_accept(LIBC_ACCEPT_SIG)
 		goto error;
 	}
 
+	sa_len = sizeof(sa);
+
 	ret = getsockname(sockfd, &sa, &sa_len);
 	if (ret < 0) {
 		PERROR("[accept] getsockname");
@@ -113,6 +115,8 @@ LIBC_ACCEPT4_RET_TYPE tsocks_accept4(LIBC_ACCEPT4_SIG)
 		goto error;
 	}
 
+	sa_len = sizeof(sa);
+
 	ret = getsockname(sockfd, &sa, &sa_len);
 	if (ret < 0) {
 		PERROR("[accept4] getsockname");



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits