From dc5e83324d429b435344693bc4e0518f2e18d552 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 20 Jun 2008 22:04:34 -0700 Subject: [PATCH] --- yaml --- r: 98366 b: refs/heads/master c: 735ce972fbc8a65fb17788debd7bbe7b4383cc62 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/sctp/socket.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d561d3e0be59..545e2a01e0be 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2645a3c3761ac25498db2e627271016c849c68e1 +refs/heads/master: 735ce972fbc8a65fb17788debd7bbe7b4383cc62 diff --git a/trunk/net/sctp/socket.c b/trunk/net/sctp/socket.c index e7e3baf7009e..0dbcde6758ea 100644 --- a/trunk/net/sctp/socket.c +++ b/trunk/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