From 2e1861546a3200f4b98c889a3c4a57fd19145a2e Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Thu, 31 Jan 2013 08:10:37 +0000 Subject: PR other/543413 * md5.c (md5_process_block): Handle case that size_t is a wider-integer-scalar a 32-bit unsigned integer. --- libiberty/ChangeLog | 6 ++++++ libiberty/md5.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'libiberty') diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 4479c77f274..2a91c419dde 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2013-01-31 Kai Tietz + + PR other/543413 + * md5.c (md5_process_block): Handle case that size_t is + a wider-integer-scalar a 32-bit unsigned integer. + 2013-01-04 Ian Lance Taylor PR other/54800 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. */ -- cgit v1.2.1