From 58912f68c2489bcee787599837447e0d64dfd61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 24 May 2017 21:03:56 +0200 Subject: New upstream version 1.0.27 --- lib/md5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/md5.c') diff --git a/lib/md5.c b/lib/md5.c index fd53191..72b36f3 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -133,8 +133,8 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | + ((md5_uint32 *) ctx->buffer)[bytes + pad] = SWAP (ctx->total[0] << 3); + ((md5_uint32 *) ctx->buffer)[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ -- cgit v1.2.3 From 1687222e1b9e74c89cafbb5910e72d8ec7bfd40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 31 Jul 2019 16:59:49 +0200 Subject: New upstream version 1.0.28 --- lib/md5.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/md5.c') diff --git a/lib/md5.c b/lib/md5.c index 72b36f3..923a17c 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -123,6 +123,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; + size_t offset; /* Now count remaining bytes. */ ctx->total[0] += bytes; @@ -133,9 +134,11 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ - ((md5_uint32 *) ctx->buffer)[bytes + pad] = SWAP (ctx->total[0] << 3); - ((md5_uint32 *) ctx->buffer)[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | - (ctx->total[0] >> 29)); + offset = (bytes + pad) / sizeof (md5_uint32); + ((md5_uint32 *) ctx->buffer)[offset] = SWAP (ctx->total[0] << 3); + offset = (bytes + pad + 4) / sizeof (md5_uint32); + ((md5_uint32 *) ctx->buffer)[offset] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); -- cgit v1.2.3