From d37c1991361f23318d549a0af62afa50a2382984 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 3 Jul 2007 13:11:56 +0000 Subject: r23683: Check ports are in the correct range (1-65535) (This used to be commit 84b193a7d95aa8c00da2a3720ee87a7231e0fc6e) --- source3/smbd/sockinit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/smbd/sockinit.c b/source3/smbd/sockinit.c index a4b9d63810..9d46776f89 100644 --- a/source3/smbd/sockinit.c +++ b/source3/smbd/sockinit.c @@ -63,7 +63,7 @@ static int init_sockets_smbd(const char *smb_ports, int listenset[FD_SETSIZE]) for (ptr=ports; next_token(&ptr, tok, " \t,", sizeof(tok)); ) { unsigned port = atoi(tok); - if (port == 0) { + if (port == 0 || port > 0xffff) { continue; } s = listenset[num_sockets] = open_socket_in(SOCK_STREAM, port, 0, ifip->s_addr, True); @@ -101,7 +101,7 @@ static int init_sockets_smbd(const char *smb_ports, int listenset[FD_SETSIZE]) for (ptr=ports; next_token(&ptr, tok, " \t,", sizeof(tok)); ) { unsigned port = atoi(tok); - if (port == 0) continue; + if (port == 0 || port > 0xffff) continue; /* open an incoming socket */ s = open_socket_in(SOCK_STREAM, port, 0, interpret_addr(lp_socket_address()),True); -- cgit