From patchwork Wed Jan 30 17:44:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [libiberty] : Fix PR 543413 Date: Wed, 30 Jan 2013 07:44:31 -0000 From: Kai Tietz X-Patchwork-Id: 216989 Message-Id: To: GCC Patches Cc: Binutils , gdb Hi, this patch fixes wrong handling of cases that bitness of size_t is wider as 32-bit. ChangeLog 2013-01-30 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. Tested for x86_64-unknown-linux-gnu, i686-pc-cygwin, and x86_64-w64-mingw32. Ok for apply? Regards, Kai Index: md5.c =================================================================== --- md5.c (Revision 195578) +++ md5.c (Arbeitskopie) @@ -293,8 +293,7 @@ md5_process_block (const void *buffer, size_t len, 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. */