re PR c++/90010 (valgrind error with snprintf and -Wall)
authorJakub Jelinek <jakub@redhat.com>
Wed, 10 Apr 2019 07:27:20 +0000 (09:27 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 10 Apr 2019 07:27:20 +0000 (09:27 +0200)
commitc9c5e18883125c90b3cbdb61b651719253a0ff90
tree00926960cbc7944e903ff64d68d4c2c050f5b285
parent7e1ab2dc3f5e9d59ecff8275fc107b126248048a
re PR c++/90010 (valgrind error with snprintf and -Wall)

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.

From-SVN: r270246
gcc/ChangeLog
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr90010.c [new file with mode: 0644]