This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 6/6] detect unterminated const arrays in strnlen calls (PR 86552)
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 30 Aug 2018 17:25:22 -0600
- Subject: Re: [PATCH 6/6] detect unterminated const arrays in strnlen calls (PR 86552)
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
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.
> PR tree-optimization/86552 - missing warning for reading past the end of non-string arrays
> * builtins.c (expand_builtin_strnlen): Detect, avoid expanding,
> and diagnose unterminated arrays.
> * gcc.dg/warn-strnlen-no-nul.c: New.
This will have the same state and resolution as #2-#5.