diff options
Diffstat (limited to 'net/sctp/socket.c')
| -rw-r--r-- | net/sctp/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f98650cc48d8..43460a1cb6d0 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -4512,7 +4512,9 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len, | |||
| 4512 | if (copy_from_user(&getaddrs, optval, len)) | 4512 | if (copy_from_user(&getaddrs, optval, len)) |
| 4513 | return -EFAULT; | 4513 | return -EFAULT; |
| 4514 | 4514 | ||
| 4515 | if (getaddrs.addr_num <= 0) return -EINVAL; | 4515 | if (getaddrs.addr_num <= 0 || |
| 4516 | getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr))) | ||
| 4517 | return -EINVAL; | ||
| 4516 | /* | 4518 | /* |
| 4517 | * For UDP-style sockets, id specifies the association to query. | 4519 | * For UDP-style sockets, id specifies the association to query. |
| 4518 | * If the id field is set to the value '0' then the locally bound | 4520 | * If the id field is set to the value '0' then the locally bound |
