diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-11-30 14:50:43 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-11-30 14:50:43 +0000 |
commit | e613205cefe50e429bafba2bc4cb71126b1f36df (patch) | |
tree | f30b1f41724d3288f8bdba58298d4d1aecd8960d /config.sub | |
parent | e6383ae7a73164277026cf815315e39f281e6aca (diff) | |
download | gcc-e613205cefe50e429bafba2bc4cb71126b1f36df.tar.gz |
libiberty: avoid reading past end of buffer in strndup/xstrndup (PR c/78498)
gcc/ChangeLog:
PR c/78498
* selftest.c (selftest::assert_strndup_eq): New function.
(selftest::test_strndup): New function.
(selftest::test_libiberty): New function.
(selftest::selftest_c_tests): Call test_libiberty.
gcc/testsuite/ChangeLog:
PR c/78498
* gcc.dg/format/pr78494.c: New test case.
libiberty/ChangeLog:
PR c/78498
* strndup.c (strlen): Delete decl.
(strnlen): Add decl.
(strndup): Call strnlen rather than strlen.
* xstrndup.c (xstrndup): Likewise.
From-SVN: r243030
Diffstat (limited to 'config.sub')
0 files changed, 0 insertions, 0 deletions