Skip to content

Commit c4d9299

Browse files
committed
Fix access annotation for stpncpy/strncpy
The dsize parameter is the length of the dst, not the length of the src. Reported-by: ncopa
1 parent 9014b02 commit c4d9299

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/string.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ _FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
198198

199199
#undef stpncpy
200200
__fh_access(write_only, 1)
201-
__fh_access(read_only, 2, 3)
201+
__fh_access(read_only, 2)
202202
#if __has_builtin(__builtin_stpncpy)
203203
__diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3)
204204
#endif
@@ -304,7 +304,7 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
304304
}
305305

306306
__fh_access (write_only, 1)
307-
__fh_access (read_only, 2, 3)
307+
__fh_access (read_only, 2)
308308
#if __has_builtin(__builtin_strncpy)
309309
__diagnose_as_builtin(__builtin_strncpy, 1, 2, 3)
310310
#endif

0 commit comments

Comments
 (0)