| Submitter | Ian Taylor |
|---|---|
| Date | Sept. 23, 2011, 7:19 p.m. |
| Message ID | <mcraa9vukv6.fsf@coign.corp.google.com> |
| Download | mbox | patch |
| Permalink | /patch/116172/ |
| State | New |
| Headers | show |
Comments
On Fri, 23 Sep 2011 12:19:57 -0700 Ian Lance Taylor <iant@google.com> wrote: > I committed this patch to mainline to fix the problem. Bootstrapped on > x86_64-unknown-linux-gnu. > > 2011-09-23 Ian Lance Taylor <iant@google.com> > > * md5.c (md5_process_bytes): Correct handling of unaligned > buffer. This is *exactly* the same patch as Pierre Vittet proposed in http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00963.html (but Pierre's patch has not been reviewed). Perhaps the ChangeLog might also mention Pierre Vittet for that particular patch??? Cheers.
Basile Starynkevitch <basile@starynkevitch.net> writes: > On Fri, 23 Sep 2011 12:19:57 -0700 > Ian Lance Taylor <iant@google.com> wrote: > >> I committed this patch to mainline to fix the problem. Bootstrapped on >> x86_64-unknown-linux-gnu. >> >> 2011-09-23 Ian Lance Taylor <iant@google.com> >> >> * md5.c (md5_process_bytes): Correct handling of unaligned >> buffer. > > This is *exactly* the same patch as > Pierre Vittet proposed in http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00963.html > (but Pierre's patch has not been reviewed). > > Perhaps the ChangeLog might also mention Pierre Vittet for that particular patch??? Sorry, I didn't see his patch. Sure, go ahead and change libiberty/ChangeLog. Note that as I explained in my message we should not remove the _STRING_ARCH_unaligned test. Ian
Patch
Index: md5.c =================================================================== --- md5.c (revision 179127) +++ md5.c (working copy) @@ -1,6 +1,6 @@ /* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2011 Free Software Foundation, Inc. NOTE: This source is derived from an old version taken from the GNU C Library (glibc). @@ -245,9 +245,11 @@ md5_process_bytes (const void *buffer, s } else #endif - md5_process_block (buffer, len & ~63, ctx); - buffer = (const void *) ((const char *) buffer + (len & ~63)); - len &= 63; + { + md5_process_block (buffer, len & ~63, ctx); + buffer = (const void *) ((const char *) buffer + (len & ~63)); + len &= 63; + } } /* Move remaining bytes in internal buffer. */