summaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-07-07 22:21:34 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-07 22:21:34 +0100
commitfa6868508a0102b150ca03d976e3a1c234e4e387 (patch)
tree2b252f262695544e5caeb2bd983f8cac5158a8f6 /net/sctp/socket.c
parent5b2353859f87748f0707cec57c3953022a3321f3 (diff)
parent4ed47896935573c8423d05bddda3f269d6e6c613 (diff)
downloadtalos-obmc-linux-fa6868508a0102b150ca03d976e3a1c234e4e387.tar.gz
talos-obmc-linux-fa6868508a0102b150ca03d976e3a1c234e4e387.zip
Merge branch 'machtypes' into orion
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index e7e3baf7009e..0dbcde6758ea 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4401,7 +4401,9 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
if (copy_from_user(&getaddrs, optval, len))
return -EFAULT;
- if (getaddrs.addr_num <= 0) return -EINVAL;
+ if (getaddrs.addr_num <= 0 ||
+ getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr)))
+ return -EINVAL;
/*
* For UDP-style sockets, id specifies the association to query.
* If the id field is set to the value '0' then the locally bound
OpenPOWER on IntegriCloud