summaryrefslogtreecommitdiff
path: root/libiberty/md5.c
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2013-01-31 09:11:43 +0100
committerKai Tietz <ktietz@gcc.gnu.org>2013-01-31 09:11:43 +0100
commitb1a2e8c606606a13693bd52833a507edecf0dd24 (patch)
treea74f03175b996353405312f585cf1933ef7b8afe /libiberty/md5.c
parent2f0c9af59fa36947485c1e88895277ea2f5ea77b (diff)
2013-01-31 Kai Tietz <ktietz@redhat.com>
PR other/543413 * md5.c (md5_process_block): Handle case that size_t is a wider-integer-scalar a 32-bit unsigned integer. From-SVN: r195600
Diffstat (limited to 'libiberty/md5.c')
-rw-r--r--libiberty/md5.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libiberty/md5.c b/libiberty/md5.c
index 8cc0cb5fe96..b30a6b7bfc5 100644
--- a/libiberty/md5.c
+++ b/libiberty/md5.c
@@ -293,8 +293,7 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len);
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */