[tor-commits] [torsocks/master] Fix: add missing optlen assignement in connect

dgoulet at torproject.org dgoulet at torproject.org
Fri Apr 4 22:40:25 UTC 2014


commit 70f79ab4350692f5f120ef216c507ab9f2a871de
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Mon Aug 5 11:58:46 2013 -0400

    Fix: add missing optlen assignement in connect
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/lib/connect.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/connect.c b/src/lib/connect.c
index 6ab2a82..6d84cc8 100644
--- a/src/lib/connect.c
+++ b/src/lib/connect.c
@@ -38,6 +38,7 @@ LIBC_CONNECT_RET_TYPE tsocks_connect(LIBC_CONNECT_SIG)
 
 	DBG("Connect catched on fd %d", __sockfd);
 
+	optlen = sizeof(sock_type);
 	ret = getsockopt(__sockfd, SOL_SOCKET, SO_TYPE, &sock_type, &optlen);
 	if (ret < 0) {
 		/* Use the getsockopt() errno value. */





More information about the tor-commits mailing list