From 10133ece1a449eecd3b13c577b338c9acf9ad579 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 31 Mar 2012 19:06:59 -0400 Subject: [PATCH] hcrypto: Use correct size for memset in md2 md2.c was doing memset(m, 0, sizeof(m)), and so was only clearing the first 4 bytes of the passed md2 structure in MD2_Final. Fix this to clear the entire structure, as expected. --- lib/hcrypto/md2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hcrypto/md2.c b/lib/hcrypto/md2.c index 26254acee..b6517a631 100644 --- a/lib/hcrypto/md2.c +++ b/lib/hcrypto/md2.c @@ -130,5 +130,5 @@ MD2_Final (void *res, struct md2 *m) MD2_Update(m, pad, 16); memcpy(res, m->state, MD2_DIGEST_LENGTH); - memset(m, 0, sizeof(m)); + memset(m, 0, sizeof(*m)); }