From patchwork Tue Jan 15 00:57:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 211965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 414222C009A for ; Tue, 15 Jan 2013 11:58:04 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1358816285; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:To:Cc:Subject:Message-Id:Date:From: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=g740jV+mgs1+Tvw1jKdq 087NmHs=; b=OEbRfSU12vQ4tYHgDrx1NaK+MKOsYr7EuaRo8/bzgKiUOeSj54Sp hAb5GaYZMF+ZwJSLwO+VkD7bqRl08u4j184wppz4gjsdF2Beu9a1UtNHtX/B/XQ9 5hNYm/3zEsYUjO4h/jGUMXRxvejnUheVkSIVMg/PDxMR/7S8BJcvO1Y= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:X-Received:Received:Received:Received:To:Cc:Subject:Message-Id:Date:From:X-Gm-Message-State:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=pxqBI/fXxZ9eUWWjZEjf3UfWjRWP5jGxIfkE2fcDcPDhgPKHsQYtEoc/EIt+Oc f7tObhGgXoOZo1Iv3VoRLfGQHQuVXOmpc/8PzI+QNfRZSrMXyJ4n4EUxceJ/TmH5 /88qoDD/ZNvI7F5k1fs6DNu1Le4s8/HOf+P71d7RasfO8=; Received: (qmail 18581 invoked by alias); 15 Jan 2013 00:57:51 -0000 Received: (qmail 18568 invoked by uid 22791); 15 Jan 2013 00:57:49 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ye0-f202.google.com (HELO mail-ye0-f202.google.com) (209.85.213.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jan 2013 00:57:43 +0000 Received: by mail-ye0-f202.google.com with SMTP id r9so570972yen.5 for ; Mon, 14 Jan 2013 16:57:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:cc:subject:message-id:date:from:x-gm-message-state; bh=HWBMOflDslnqQVOS+uqw7zfkRKfv1XaAnUThZggEFmM=; b=kH5pgQvRBHeycF2fi159wjKot959LlHIWyZT9b5dIS5IGzuHwk/dlFtMBuNuGNrO/I s0zlwMtmD8AurYZGhipROZZ22//KMMMb+qdJsQuePmCKDMTPXCrWFV+bxeZIMYV/HsSG P+gm33wcd67qSvATDBNzhHlIsP+8Tz0afP6H8+epqIp+F2I/+11B73duMag+1VcaXnIn q4hbUJSb/0B35khPDempZ3JGAPXvc6tzOrRdC+vO4pEIhaBqwHL9ezJiFb1cI2iIOH+i 8nh0VAa/lTdvhfTW4oUae+HaOgwYpTRUgWmcEtvBmlEPIUjhE7Kg3sUAzOj+G1B1jwRu JsnA== X-Received: by 10.236.124.102 with SMTP id w66mr48532258yhh.38.1358211462946; Mon, 14 Jan 2013 16:57:42 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id s78si791719yhh.3.2013.01.14.16.57.42 (version=TLSv1 cipher=AES128-SHA bits=128/128); Mon, 14 Jan 2013 16:57:42 -0800 (PST) Received: from elbrus2.mtv.corp.google.com (elbrus2.mtv.corp.google.com [172.17.128.95]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id BB56782004A; Mon, 14 Jan 2013 16:57:42 -0800 (PST) Received: by elbrus2.mtv.corp.google.com (Postfix, from userid 74925) id 5C0D01908E4; Mon, 14 Jan 2013 16:57:42 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com, ppluzhnikov@google.com Subject: [patch] PR55982 Fix buglet in __strncat_chk Message-Id: <20130115005742.5C0D01908E4@elbrus2.mtv.corp.google.com> Date: Mon, 14 Jan 2013 16:57:42 -0800 (PST) From: ppluzhnikov@google.com (Paul Pluzhnikov) X-Gm-Message-State: ALoCoQk4D/YXvfPbQQzXmlKu7nk/OWKXfEy7o5ZC2Y6CRApQFQq7m3uW+pZw36hwdm6DnFr2BxI4oAIlu9smPn7JvAbuWWglsYLGiwdsEOaYBVr4StO+hPUVKwBowT5ahd0RBy+DPa0Hac4IUCmzLUTdJJWC33AdxkQmo1Vir+KTCY60VweOKQ580BiQzn9pag0ZXq7zQVdutFiOOLxEFDXlB86VOu68m0oqGr7VzBiw7AjkXtVS1mE= Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Greetings, In libssp/strncat-chk.c, the loop was unrolled 5 times (apparently by accident). Ok for trunk? Thanks, --- Paul Pluzhnikov 2013-01-14 Paul Pluzhnikov PR 55982 * strncat-chk.c (__strncat_chk): Fix loop unroll. Index: libssp/strncat-chk.c =================================================================== --- libssp/strncat-chk.c (revision 195181) +++ libssp/strncat-chk.c (working copy) @@ -87,12 +87,6 @@ __strncat_chk (char *__restrict__ dest, const char *++dest = c; if (c == '\0') return s; - if (slen-- == 0) - __chk_fail (); - c = *src++; - *++dest = c; - if (c == '\0') - return s; } while (--n4 > 0); n &= 3; }