diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2013-01-31 08:10:38 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2013-01-31 08:10:38 +0000 |
commit | fe4b0b463295fa285e1cf4acdde92208c29c48ec (patch) | |
tree | 08fe61883e1e343e9a27ec94e57c9cb59ec21537 /libiberty/md5.c | |
parent | b45b6908c154735e69e2dfefd34748f79ca85753 (diff) | |
download | gdb-fe4b0b463295fa285e1cf4acdde92208c29c48ec.zip gdb-fe4b0b463295fa285e1cf4acdde92208c29c48ec.tar.gz gdb-fe4b0b463295fa285e1cf4acdde92208c29c48ec.tar.bz2 |
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/md5.c')
-rw-r--r-- | libiberty/md5.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libiberty/md5.c b/libiberty/md5.c index 8cc0cb5..b30a6b7 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. */ |