summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-07-03 13:11:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:45 -0500
commitd37c1991361f23318d549a0af62afa50a2382984 (patch)
treec97567b6e199d4725e6f83abcbbef6bdfdddeeb4 /source3
parentb85bfd50663bbec07313d626ad3845f2a9fcfd3c (diff)
downloadsamba-d37c1991361f23318d549a0af62afa50a2382984.tar.gz
samba-d37c1991361f23318d549a0af62afa50a2382984.tar.bz2
samba-d37c1991361f23318d549a0af62afa50a2382984.zip
r23683: Check ports are in the correct range (1-65535)
(This used to be commit 84b193a7d95aa8c00da2a3720ee87a7231e0fc6e)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/sockinit.c4
1 files 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);