From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42759 invoked by alias); 30 Aug 2018 23:25:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 42655 invoked by uid 89); 30 Aug 2018 23:25:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Aug 2018 23:25:25 +0000 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 715EF308330B; Thu, 30 Aug 2018 23:25:24 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-11.rdu2.redhat.com [10.10.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DF432010CAB; Thu, 30 Aug 2018 23:25:23 +0000 (UTC) Subject: Re: [PATCH 6/6] detect unterminated const arrays in strnlen calls (PR 86552) To: Martin Sebor , Gcc Patch List References: <90953771-af77-b1a6-2215-fc48a07cebd6@gmail.com> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <67bd1bcf-da25-b622-babc-4ef1ce854416@redhat.com> Date: Thu, 30 Aug 2018 23:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <90953771-af77-b1a6-2215-fc48a07cebd6@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg02006.txt.bz2 On 08/13/2018 03:29 PM, Martin Sebor wrote: > The attached changes implement the detection of past-the-end reads > by strncpy due to unterminated arguments and excessive bounds. > > > gcc-86552-6.diff > > > PR tree-optimization/86552 - missing warning for reading past the end of non-string arrays > > gcc/ChangeLog: > * builtins.c (expand_builtin_strnlen): Detect, avoid expanding, > and diagnose unterminated arrays. > > gcc/testsuite/ChangeLog: > * gcc.dg/warn-strnlen-no-nul.c: New. This will have the same state and resolution as #2-#5. jeff