[SCTP]: sctp_unpack_cookie() fix
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 20 Jun 2006 10:26:14 +0000 (03:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jun 2006 10:26:14 +0000 (03:26 -0700)
sizeof(pointer) != sizeof(array)...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sm_make_chunk.c

index 5e0de3c0eead5309e908ec7365e53d2dcf759932..2a8773691695243fe6b4901f4b3a7f3328b78665 100644 (file)
@@ -1402,14 +1402,14 @@ struct sctp_association *sctp_unpack_cookie(
        sg.length = bodysize;
        key = (char *)ep->secret_key[ep->current_key];
 
-       memset(digest, 0x00, sizeof(digest));
+       memset(digest, 0x00, SCTP_SIGNATURE_SIZE);
        sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg,
                         1, digest);
 
        if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
                /* Try the previous key. */
                key = (char *)ep->secret_key[ep->last_key];
-               memset(digest, 0x00, sizeof(digest));
+               memset(digest, 0x00, SCTP_SIGNATURE_SIZE);
                sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
                                 &sg, 1, digest);