diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-10 16:40:37 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-10 18:24:14 +0200 |
commit | 86b7b5cd9621946a3ea20905c0559d662c84770b (patch) | |
tree | 398f131a36ab1d09fa6155852e6fbb846930b372 /lib/socket_wrapper | |
parent | 1be5a9b1fdbf891749615e87391cdd2a9c4d7113 (diff) | |
download | samba-86b7b5cd9621946a3ea20905c0559d662c84770b.tar.gz samba-86b7b5cd9621946a3ea20905c0559d662c84770b.tar.bz2 samba-86b7b5cd9621946a3ea20905c0559d662c84770b.zip |
socket_wrapper: make sure interfaces are in the valid range on bind()
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jul 10 18:24:14 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/socket_wrapper')
-rw-r--r-- | lib/socket_wrapper/socket_wrapper.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index d70459ba08..2b526262bd 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -554,6 +554,11 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in if (bcast) *bcast = is_bcast; + if (iface == 0 || iface > MAX_WRAPPED_INTERFACES) { + errno = EINVAL; + return -1; + } + if (prt == 0) { /* handle auto-allocation of ephemeral ports */ for (prt = 5001; prt < 10000; prt++) { |