aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index eb17a911aa29..3253f724a995 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3891,13 +3891,17 @@ static int sctp_setsockopt_reset_streams(struct sock *sk,
3891 struct sctp_association *asoc; 3891 struct sctp_association *asoc;
3892 int retval = -EINVAL; 3892 int retval = -EINVAL;
3893 3893
3894 if (optlen < sizeof(struct sctp_reset_streams)) 3894 if (optlen < sizeof(*params))
3895 return -EINVAL; 3895 return -EINVAL;
3896 3896
3897 params = memdup_user(optval, optlen); 3897 params = memdup_user(optval, optlen);
3898 if (IS_ERR(params)) 3898 if (IS_ERR(params))
3899 return PTR_ERR(params); 3899 return PTR_ERR(params);
3900 3900
3901 if (params->srs_number_streams * sizeof(__u16) >
3902 optlen - sizeof(*params))
3903 goto out;
3904
3901 asoc = sctp_id2assoc(sk, params->srs_assoc_id); 3905 asoc = sctp_id2assoc(sk, params->srs_assoc_id);
3902 if (!asoc) 3906 if (!asoc)
3903 goto out; 3907 goto out;