summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2013-01-31 08:10:37 +0000
committerKai Tietz <kai.tietz@onevision.com>2013-01-31 08:10:37 +0000
commita8bf60705c4d73895d77ed431841bfd06c53c559 (patch)
tree035b034576146ae2dc56174a4157f0dc86a85fb9 /libiberty
parentc90bf3234778074c602f9eae84bb400f9dc3cbf2 (diff)
downloadbinutils-redhat-a8bf60705c4d73895d77ed431841bfd06c53c559.tar.gz
PR other/543413
* md5.c (md5_process_block): Handle case that size_t is a wider-integer-scalar a 32-bit unsigned integer.
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/md5.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 4479c77f27..2a91c419dd 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2013-01-04 Ian Lance Taylor <iant@google.com>
PR other/54800
diff --git a/libiberty/md5.c b/libiberty/md5.c
index 8cc0cb5fe9..b30a6b7bfc 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. */