-
- Downloads
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
Showing
- gcc/ChangeLog 8 additions, 0 deletionsgcc/ChangeLog
- gcc/selftest.c 48 additions, 0 deletionsgcc/selftest.c
- gcc/testsuite/ChangeLog 5 additions, 0 deletionsgcc/testsuite/ChangeLog
- gcc/testsuite/gcc.dg/format/pr78494.c 12 additions, 0 deletionsgcc/testsuite/gcc.dg/format/pr78494.c
- libiberty/ChangeLog 8 additions, 0 deletionslibiberty/ChangeLog
- libiberty/strndup.c 2 additions, 5 deletionslibiberty/strndup.c
- libiberty/xstrndup.c 1 addition, 4 deletionslibiberty/xstrndup.c
Loading
Please register or sign in to comment