diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-16 14:16:08 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-16 14:16:08 -0300 |
commit | 3326a1803802aa4730d32304b003f50720996b31 (patch) | |
tree | 1caa6541b94c3a6acb86cbc142d399598152b170 /net/sctp/socket.c | |
parent | 29f5b648fa0b31ad614c78468b9279e5fa96397a (diff) |
Linux-libre 4.8.8-gnupck-4.8.8-gnu
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 8ed2d99bd..baccbf3c1 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4683,7 +4683,7 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len, static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval, int __user *optlen) { - if (len <= 0) + if (len == 0) return -EINVAL; if (len > sizeof(struct sctp_event_subscribe)) len = sizeof(struct sctp_event_subscribe); @@ -6426,6 +6426,9 @@ static int sctp_getsockopt(struct sock *sk, int level, int optname, if (get_user(len, optlen)) return -EFAULT; + if (len < 0) + return -EINVAL; + lock_sock(sk); switch (optname) { |