[PATCH] sctp_unpack_cookie() fix

From: Al Viro
Date: Thu Jun 15 2006 - 06:59:23 EST


sizeof(pointer) != sizeof(array)...

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

---

net/sctp/sm_make_chunk.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

ce06687e3f7fea0950ce36423349d113e9cd0d3a
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 5e0de3c..2a87736 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1402,14 +1402,14 @@ struct sctp_association *sctp_unpack_coo
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);

--
1.3.GIT

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/