summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2011-07-05 23:39:27 +0000
committertedu <tedu@openbsd.org>2011-07-05 23:39:27 +0000
commitaf2bb19c19ca7b3ada960587e246a8861470d8fb (patch)
tree51f9da2aa8d4268dd2179bc7dcde1b425dc11c2f
parentfix bizarre and mostly useless initialization of an ifqueue in BSS that (diff)
downloadwireguard-openbsd-af2bb19c19ca7b3ada960587e246a8861470d8fb.tar.xz
wireguard-openbsd-af2bb19c19ca7b3ada960587e246a8861470d8fb.zip
fix memset sizeof, found by jsg. ok krw
-rw-r--r--bin/md5/md5.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index e6a26791e35..956a61b8a73 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.52 2010/10/27 15:24:10 millert Exp $ */
+/* $OpenBSD: md5.c,v 1.53 2011/07/05 23:39:27 tedu Exp $ */
/*
* Copyright (c) 2001,2003,2005-2006 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -415,7 +415,8 @@ digest_end(const struct hash_function *hf, void *ctx, char *buf, size_t bsize,
hf->final(digest, ctx);
if (b64_ntop(digest, hf->digestlen, buf, bsize) == -1)
errx(1, "error encoding base64");
- memset(digest, 0, sizeof(digest));
+ memset(digest, 0, hf->digestlen);
+ free(digest);
} else {
hf->end(ctx, buf);
}