On 01/24/2017 08:36 PM, Martin Sebor wrote:
In implementing the -Wstringop-overflow warning I missed stpcpy.
The attached patch adds the required checking.  Given how simple
it is, does it qualify for GCC 7 despite stage 4?

Martin

gcc-79222.diff


PR middle-end/79222 - missing -Wstringop-overflow= on a stpcpy overflow

gcc/ChangeLog:

        PR middle-end/79222
        * builtins.c (expand_builtin_stpcpy): Check for buffer overflow.

gcc/testsuite/ChangeLog:

        PR middle-end/79222
        * gcc.dg/builtin-stringop-chk-4.c: Add test cases.
        * gcc.dg/pr79222.c: New test.
This is OK for the trunk.

jeff

Reply via email to