Skip to contentSkip to conversation

sctp_unpack_cookie() fix

PATCH New Al Viro 1 participant 1 message Jun 15, 2006

Subsystems (2)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 sctp_unpack_cookie() fix

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

---

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

ce06687e3f7fea0950ce36423349d113e9cd0d3a

net/sctp/sm_make_chunk.c +2 -2
index 5e0de3c..2a87736 100644
@@ -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);
 
Signature · 1 line
1.3.GIT