Fossil SCM

Fix a faulty (but harmless) initialization in the MD5 code.

drh 2012-07-27 00:00 trunk
Commit ed005e302de418dd20a3b86ced7f103347422a1c
1 file changed +1 -1
+1 -1
--- src/md5.c
+++ src/md5.c
@@ -264,11 +264,11 @@
264264
((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
265265
266266
MD5Transform(ctx->buf, (uint32 *)ctx->in);
267267
byteReverse((unsigned char *)ctx->buf, 4);
268268
memcpy(digest, ctx->buf, 16);
269
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
269
+ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
270270
}
271271
272272
/*
273273
** Convert a digest into base-16. digest should be declared as
274274
** "unsigned char digest[16]" in the calling function. The MD5
275275
--- src/md5.c
+++ src/md5.c
@@ -264,11 +264,11 @@
264 ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
265
266 MD5Transform(ctx->buf, (uint32 *)ctx->in);
267 byteReverse((unsigned char *)ctx->buf, 4);
268 memcpy(digest, ctx->buf, 16);
269 memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
270 }
271
272 /*
273 ** Convert a digest into base-16. digest should be declared as
274 ** "unsigned char digest[16]" in the calling function. The MD5
275
--- src/md5.c
+++ src/md5.c
@@ -264,11 +264,11 @@
264 ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1];
265
266 MD5Transform(ctx->buf, (uint32 *)ctx->in);
267 byteReverse((unsigned char *)ctx->buf, 4);
268 memcpy(digest, ctx->buf, 16);
269 memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
270 }
271
272 /*
273 ** Convert a digest into base-16. digest should be declared as
274 ** "unsigned char digest[16]" in the calling function. The MD5
275

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button