From 86b7b5cd9621946a3ea20905c0559d662c84770b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 10 Jul 2011 16:40:37 +0200 Subject: socket_wrapper: make sure interfaces are in the valid range on bind() metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sun Jul 10 18:24:14 CEST 2011 on sn-devel-104 --- lib/socket_wrapper/socket_wrapper.c | 5 +++++ 1 file changed, 5 insertions(+) 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++) { -- cgit