[Bug middle-end/79223] missing -Wstringop-overflow on a memmove overflow

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 4 20:55:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79223

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Thu May  4 20:54:43 2017
New Revision: 247618

URL: https://gcc.gnu.org/viewcvs?rev=247618&root=gcc&view=rev
Log:
PR preprocessor/79214 -  -Wno-system-header defeats strncat buffer overflow
warnings
PR middle-end/79222 - missing -Wstringop-overflow= on a stpcpy overflow
PR middle-end/79223 - missing -Wstringop-overflow on a memmove overflow

gcc/ChangeLog:

        PR preprocessor/79214
        PR middle-end/79222
        PR middle-end/79223
        * builtins.c (check_sizes): Add inlinining context and issue
        warnings even when -Wno-system-headers is set.
        (check_strncat_sizes): Same.
        (expand_builtin_strncat): Same.
        (expand_builtin_memmove): New function.
        (expand_builtin_stpncpy): Same.
        (expand_builtin): Handle memmove and stpncpy.

gcc/testsuite/ChangeLog:

        PR preprocessor/79214
        PR middle-end/79222
        PR middle-end/79223
        * gcc.dg/pr79214.c: New test.
        * gcc.dg/pr79214.h: New test header.
        * gcc.dg/pr79222.c: New test.
        * gcc.dg/pr79223.c: New test.
        * gcc.dg/pr78138.c: Adjust.
        * gfortran.dg/unconstrained_commons.f: Same.


Added:
    trunk/gcc/testsuite/gcc.dg/pr79214.c
    trunk/gcc/testsuite/gcc.dg/pr79214.h
    trunk/gcc/testsuite/gcc.dg/pr79222.c
    trunk/gcc/testsuite/gcc.dg/pr79223.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr78138.c
    trunk/gcc/testsuite/gfortran.dg/unconstrained_commons.f


More information about the Gcc-bugs mailing list