1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

improve out-of-bounds checking with GCC 10 attribute access [BZ #25219]

Adds the access attribute newly introduced in GCC 10 to the subset of
function declarations that are already covered by _FORTIFY_SOURCE and
that don't have corresponding GCC built-in equivalents.

Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
Martin Sebor
2020-05-04 11:21:50 -06:00
parent 38c6788818
commit 06febd8c67
9 changed files with 146 additions and 82 deletions

View File

@ -75,7 +75,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len))
# include <bits/strings_fortified.h>
void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)
__THROW __nonnull ((1));
__THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2));
__fortify_function void
__NTH (explicit_bzero (void *__dest, size_t __len))
@ -108,7 +108,8 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
/* XXX We have no corresponding builtin yet. */
extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
size_t __destlen) __THROW;
size_t __destlen) __THROW
__attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2));
extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
size_t __n), stpncpy);