diff options
| author | jvoisin | 2024-07-10 16:46:15 +0200 |
|---|---|---|
| committer | jvoisin | 2024-07-10 16:46:15 +0200 |
| commit | c4d9299abf7f6b941493fc487d2ccbb47d756479 (patch) | |
| tree | 6b882dd8fde526ef0e8e53bf3c38ed7aeb03e433 /include/string.h | |
| parent | 9014b0266147dbb74d5d9e6e2c24ae9d21ad7e07 (diff) | |
Fix access annotation for stpncpy/strncpy
The dsize parameter is the length of the dst,
not the length of the src.
Reported-by: ncopa
Diffstat (limited to 'include/string.h')
| -rw-r--r-- | include/string.h | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
| 198 | 198 | ||
| 199 | #undef stpncpy | 199 | #undef stpncpy |
| 200 | __fh_access(write_only, 1) | 200 | __fh_access(write_only, 1) |
| 201 | __fh_access(read_only, 2, 3) | 201 | __fh_access(read_only, 2) |
| 202 | #if __has_builtin(__builtin_stpncpy) | 202 | #if __has_builtin(__builtin_stpncpy) |
| 203 | __diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3) | 203 | __diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3) |
| 204 | #endif | 204 | #endif |
| @@ -304,7 +304,7 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s, | |||
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | __fh_access (write_only, 1) | 306 | __fh_access (write_only, 1) |
| 307 | __fh_access (read_only, 2, 3) | 307 | __fh_access (read_only, 2) |
| 308 | #if __has_builtin(__builtin_strncpy) | 308 | #if __has_builtin(__builtin_strncpy) |
| 309 | __diagnose_as_builtin(__builtin_strncpy, 1, 2, 3) | 309 | __diagnose_as_builtin(__builtin_strncpy, 1, 2, 3) |
| 310 | #endif | 310 | #endif |
