[Bug c++/90010] [8 Regression] valgrind error with snprintf and -Wall

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 30 21:01:00 GMT 2019


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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Apr 30 21:00:42 2019
New Revision: 270746

URL: https://gcc.gnu.org/viewcvs?rev=270746&root=gcc&view=rev
Log:
        2019-04-10  Jakub Jelinek  <jakub@redhat.com>

        PR c++/90010
        * gimple-ssa-sprintf.c (target_to_host): Fix handling of targstr
        with strlen in between hostsz-3 and hostsz-1 inclusive when no
        translation is needed, and when translation is needed, only append
        ... if the string length is hostsz or more bytes long.  Avoid using
        strncpy or strcat.

        * gcc.dg/pr90010.c: New test.

Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/pr90010.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/gimple-ssa-sprintf.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list