From: Kai Tietz <ktietz70@googlemail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Binutils <binutils@sourceware.org>, gdb <gdb@sourceware.org>
Subject: [patch libiberty]: Fix PR 543413
Date: Wed, 30 Jan 2013 17:44:00 -0000 [thread overview]
Message-ID: <CAEwic4Y2+BW3984jy6UtGtOOG8gZLW06MhDLNLFrFmGKhh1qpQ@mail.gmail.com> (raw)
Hi,
this patch fixes wrong handling of cases that bitness of size_t is
wider as 32-bit.
ChangeLog
2013-01-30 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.
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. */
next reply other threads:[~2013-01-30 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 17:44 Kai Tietz [this message]
2013-01-30 22:51 ` Ian Lance Taylor
2013-01-31 9:11 ` Rainer Orth
2013-01-31 9:14 ` Kai Tietz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEwic4Y2+BW3984jy6UtGtOOG8gZLW06MhDLNLFrFmGKhh1qpQ@mail.gmail.com \
--to=ktietz70@googlemail.com \
--cc=binutils@sourceware.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox