From 22bb8f49d713bd8ff464abcd731d7326030859fe Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 27 Jun 2023 17:33:06 +0200 Subject: Add more access-annotations --- include/stdio.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/stdio.h') diff --git a/include/stdio.h b/include/stdio.h index 372fd3e..cc16e46 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -47,6 +47,7 @@ _FORTIFY_FN(fgets) char *fgets(char * _FORTIFY_POS0 __s, int __n, FILE *__f) return __orig_fgets(__s, __n, __f); } +__access(write_only, 1) _FORTIFY_FN(fread) size_t fread(void * _FORTIFY_POS0 __d, size_t __n, size_t __m, FILE *__f) { @@ -59,6 +60,7 @@ _FORTIFY_FN(fread) size_t fread(void * _FORTIFY_POS0 __d, size_t __n, return __orig_fread(__d, __n, __m, __f); } +__access(read_only, 1) _FORTIFY_FN(fwrite) size_t fwrite(const void * _FORTIFY_POS0 __d, size_t __n, size_t __m, FILE *__f) { @@ -71,6 +73,7 @@ _FORTIFY_FN(fwrite) size_t fwrite(const void * _FORTIFY_POS0 __d, size_t __n, return __orig_fwrite(__d, __n, __m, __f); } +__access(read_write, 1, 2) _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n, const char *__f, __builtin_va_list __v) { @@ -112,6 +115,7 @@ _FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f, * 3) not implementing these under clang, which is what we do for now */ +__access(read_write, 1, 2) _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, const char *__f, ...) { -- cgit v1.3