summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2013-02-07 04:43:49 +0000
committerDJ Delorie <dj@delorie.com>2013-02-07 04:43:49 +0000
commitc9423f319bf6346f8ad17a48b4d6a757b5e84dd8 (patch)
treeb64dad5a565e6a409c79d7f513e48fd729d2c402 /libiberty
parenteabf5455b8424361dc9b3799b02311e7b48acb7d (diff)
downloadbinutils-redhat-c9423f319bf6346f8ad17a48b4d6a757b5e84dd8.tar.gz
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/sha1.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2a91c419dd..cbcd1e2594 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,6 +1,10 @@
2013-01-31 Kai Tietz <ktietz@redhat.com>
- PR other/543413
+ PR other/54620
+ * sha1.c (sha1_process_block): Handle case that size_t is
+ a wider-integer-scalar as a 32-bit unsigned integer.
+
+ PR other/53413
* md5.c (md5_process_block): Handle case that size_t is
a wider-integer-scalar a 32-bit unsigned integer.
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index 6a25ab2399..617e743a15 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -300,8 +300,7 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_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);
#define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n))))