Fossil SCM
Fix a faulty (but harmless) initialization in the MD5 code.
Commit
ed005e302de418dd20a3b86ced7f103347422a1c
Parent
bff50b17eb9fc6c…
1 file changed
+1
-1
+1
-1
| --- src/md5.c | ||
| +++ src/md5.c | ||
| @@ -264,11 +264,11 @@ | ||
| 264 | 264 | ((uint32 *)ctx->in)[ 15 ] = ctx->bits[1]; |
| 265 | 265 | |
| 266 | 266 | MD5Transform(ctx->buf, (uint32 *)ctx->in); |
| 267 | 267 | byteReverse((unsigned char *)ctx->buf, 4); |
| 268 | 268 | 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 */ | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /* |
| 273 | 273 | ** Convert a digest into base-16. digest should be declared as |
| 274 | 274 | ** "unsigned char digest[16]" in the calling function. The MD5 |
| 275 | 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 |
| --- 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 |