diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index bb5c9ef13046..afa952e726d7 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3144,6 +3144,11 @@ static int sctp_setsockopt_auth_key(struct sock *sk, | |||
3144 | goto out; | 3144 | goto out; |
3145 | } | 3145 | } |
3146 | 3146 | ||
3147 | if (authkey->sca_keylength > optlen) { | ||
3148 | ret = -EINVAL; | ||
3149 | goto out; | ||
3150 | } | ||
3151 | |||
3147 | asoc = sctp_id2assoc(sk, authkey->sca_assoc_id); | 3152 | asoc = sctp_id2assoc(sk, authkey->sca_assoc_id); |
3148 | if (!asoc && authkey->sca_assoc_id && sctp_style(sk, UDP)) { | 3153 | if (!asoc && authkey->sca_assoc_id && sctp_style(sk, UDP)) { |
3149 | ret = -EINVAL; | 3154 | ret = -EINVAL; |