From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23662 invoked by alias); 30 Jan 2013 17:44:39 -0000 Received: (qmail 23534 invoked by uid 22791); 30 Jan 2013 17:44:37 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f170.google.com (HELO mail-ie0-f170.google.com) (209.85.223.170) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Jan 2013 17:44:32 +0000 Received: by mail-ie0-f170.google.com with SMTP id c11so1567882ieb.29 for ; Wed, 30 Jan 2013 09:44:32 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.16.210 with SMTP id i18mr4159470igd.53.1359567871967; Wed, 30 Jan 2013 09:44:31 -0800 (PST) Received: by 10.64.34.172 with HTTP; Wed, 30 Jan 2013 09:44:31 -0800 (PST) Date: Wed, 30 Jan 2013 17:44:00 -0000 Message-ID: Subject: [patch libiberty]: Fix PR 543413 From: Kai Tietz To: GCC Patches Cc: Binutils , gdb Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00089.txt.bz2 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. */