diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2011-07-05 23:39:28 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2011-07-05 23:39:28 +0000 |
commit | f0f96d27999759132dcbc8d2313278e6fca4f96b (patch) | |
tree | 1b55ca6528bdacbb762b6622c430cf642a88c7ab | |
parent | bc5c28b304b55dcd79360fc901647df7769368b1 (diff) |
fix memset sizeof, found by jsg. ok krw
-rw-r--r-- | bin/md5/md5.c | 5 |
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); } |