]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sctp/socket.c
sctp: correct bounds check in sctp_setsockopt_auth_key
[karo-tx-linux.git] / net / sctp / socket.c
index e62aafc320c265110373aead79c17cf02be67792..68681fee61a6cafcb6046659d2106b4ee6656be3 100644 (file)
@@ -3054,7 +3054,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
                goto out;
        }
 
-       if (authkey->sca_keylength > optlen) {
+       if (authkey->sca_keylength > optlen - sizeof(struct sctp_authkey)) {
                ret = -EINVAL;
                goto out;
        }