diff options
| -rw-r--r-- | net/ipv4/ip_sockglue.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index fc7993e9061f..5a0693576e82 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -611,6 +611,9 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
| 611 | * Check the arguments are allowable | 611 | * Check the arguments are allowable |
| 612 | */ | 612 | */ |
| 613 | 613 | ||
| 614 | if (optlen < sizeof(struct in_addr)) | ||
| 615 | goto e_inval; | ||
| 616 | |||
| 614 | err = -EFAULT; | 617 | err = -EFAULT; |
| 615 | if (optlen >= sizeof(struct ip_mreqn)) { | 618 | if (optlen >= sizeof(struct ip_mreqn)) { |
| 616 | if (copy_from_user(&mreq, optval, sizeof(mreq))) | 619 | if (copy_from_user(&mreq, optval, sizeof(mreq))) |
