From c4d9299abf7f6b941493fc487d2ccbb47d756479 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 10 Jul 2024 16:46:15 +0200 Subject: Fix access annotation for stpncpy/strncpy The dsize parameter is the length of the dst, not the length of the src. Reported-by: ncopa --- include/string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/string.h b/include/string.h index c317b1e..10d071a 100644 --- a/include/string.h +++ b/include/string.h @@ -198,7 +198,7 @@ _FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s) #undef stpncpy __fh_access(write_only, 1) -__fh_access(read_only, 2, 3) +__fh_access(read_only, 2) #if __has_builtin(__builtin_stpncpy) __diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3) #endif @@ -304,7 +304,7 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s, } __fh_access (write_only, 1) -__fh_access (read_only, 2, 3) +__fh_access (read_only, 2) #if __has_builtin(__builtin_strncpy) __diagnose_as_builtin(__builtin_strncpy, 1, 2, 3) #endif -- cgit v1.3