Message ID | lsq.1489146370.889744033@decadent.org.uk |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
--- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4193,7 +4193,7 @@ static int sctp_getsockopt_disable_fragm 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); @@ -5586,6 +5586,9 @@ SCTP_STATIC int sctp_getsockopt(struct s if (get_user(len, optlen)) return -EFAULT; + if (len < 0) + return -EINVAL; + sctp_lock_sock(sk); switch (optname) {