[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Wed Sep 3 02:35:27 MDT 2014


The branch, master has been updated
       via  20555bf tests: Add missing breaks in sockaddr assert functions.
       via  8c6a8f3 swrap: Fix out of bound access.
      from  d3c101f tests: Pass the sockaddr structure to system functions.

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 20555bf66a555a63a865bd1969a907533de4ccd2
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 3 09:04:02 2014 +0200

    tests: Add missing breaks in sockaddr assert functions.
    
    CID #72657
    CID #72656
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 8c6a8f3703928820617187cf492645ef8b8256ba
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 3 08:59:26 2014 +0200

    swrap: Fix out of bound access.
    
    CID #72659
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 src/socket_wrapper.c                     |    2 +-
 tests/test_echo_tcp_get_peer_sock_name.c |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 13b24a0..061a820 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -2727,7 +2727,7 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family)
 
 	for (i = 0; i < SOCKET_MAX_SOCKETS; i++) {
 		port = autobind_start + i;
-		snprintf(un_addr.sa.un.sun_path, un_addr.sa_socklen,
+		snprintf(un_addr.sa.un.sun_path, sizeof(un_addr.sa.un.sun_path),
 			 "%s/"SOCKET_FORMAT, socket_wrapper_dir(),
 			 type, socket_wrapper_default_iface(), port);
 		if (stat(un_addr.sa.un.sun_path, &st) == 0) continue;
diff --git a/tests/test_echo_tcp_get_peer_sock_name.c b/tests/test_echo_tcp_get_peer_sock_name.c
index 5f4a9e4..4be729c 100644
--- a/tests/test_echo_tcp_get_peer_sock_name.c
+++ b/tests/test_echo_tcp_get_peer_sock_name.c
@@ -59,8 +59,10 @@ static void _assert_sockaddr_port_equal(struct torture_address *addr,
 	switch(addr->sa.ss.ss_family) {
 	case AF_INET:
 		n_port = addr->sa.in.sin_port;
+		break;
 	case AF_INET6:
 		n_port = addr->sa.in6.sin6_port;
+		break;
 	default:
 		return;
 	}
@@ -83,8 +85,10 @@ static void _assert_sockaddr_port_range_equal(struct torture_address *addr,
 	switch(addr->sa.ss.ss_family) {
 	case AF_INET:
 		n_port = addr->sa.in.sin_port;
+		break;
 	case AF_INET6:
 		n_port = addr->sa.in6.sin6_port;
+		break;
 	default:
 		return;
 	}


-- 
Socket Wrapper Repository


More information about the samba-cvs mailing list