Browse Source

Pass sizeof(*pointer) not sizeof(point) to memset. Karsten Desler.

OPENBSD_3_6
millert 20 years ago
parent
commit
ed861eb432
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      src/lib/libc/hash/md4.c
  2. +3
    -3
      src/lib/libc/hash/md5.c

+ 3
- 3
src/lib/libc/hash/md4.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: md4.c,v 1.1 2004/04/28 16:54:00 millert Exp $ */
/* $OpenBSD: md4.c,v 1.2 2004/04/28 20:24:59 millert Exp $ */
/* /*
* This code implements the MD4 message-digest algorithm. * This code implements the MD4 message-digest algorithm.
@ -19,7 +19,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$OpenBSD: md4.c,v 1.1 2004/04/28 16:54:00 millert Exp $";
static const char rcsid[] = "$OpenBSD: md4.c,v 1.2 2004/04/28 20:24:59 millert Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -182,7 +182,7 @@ MD4Final(unsigned char digest[MD4_DIGEST_LENGTH], MD4_CTX *ctx)
MD4Transform(ctx->state, ctx->buffer); MD4Transform(ctx->state, ctx->buffer);
htole32_4(ctx->state); htole32_4(ctx->state);
memcpy(digest, ctx->state, MD4_DIGEST_LENGTH); memcpy(digest, ctx->state, MD4_DIGEST_LENGTH);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* in case it's sensitive */
} }


+ 3
- 3
src/lib/libc/hash/md5.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: md5.c,v 1.2 2004/04/28 16:52:08 millert Exp $ */
/* $OpenBSD: md5.c,v 1.3 2004/04/28 20:24:59 millert Exp $ */
/* /*
* This code implements the MD5 message-digest algorithm. * This code implements the MD5 message-digest algorithm.
@ -18,7 +18,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$OpenBSD: md5.c,v 1.2 2004/04/28 16:52:08 millert Exp $";
static const char rcsid[] = "$OpenBSD: md5.c,v 1.3 2004/04/28 20:24:59 millert Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -181,7 +181,7 @@ MD5Final(unsigned char digest[MD5_DIGEST_LENGTH], MD5_CTX *ctx)
MD5Transform(ctx->state, ctx->buffer); MD5Transform(ctx->state, ctx->buffer);
htole32_4(ctx->state); htole32_4(ctx->state);
memcpy(digest, ctx->state, MD5_DIGEST_LENGTH); memcpy(digest, ctx->state, MD5_DIGEST_LENGTH);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* in case it's sensitive */
} }


Loading…
Cancel
Save