From 9014b0266147dbb74d5d9e6e2c24ae9d21ad7e07 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 10 Jul 2024 16:03:42 +0200 Subject: Fix access annotations to snprintf/sprintf In the same spirit as the previous commit. Reported-by: ncopa --- include/stdio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stdio.h b/include/stdio.h index fcd0ac9..c1070a8 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -268,7 +268,7 @@ _FORTIFY_FN(vasprintf) int vasprintf(char **strp, const char *fmt, __builtin_va_ #undef printf #undef fprintf -__fh_access(read_write, 1, 2) +__fh_access(write_only, 1, 2) __fh_access(read_only, 3) __fh_format(printf, 3, 4) _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, @@ -286,7 +286,7 @@ _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n, } __fh_format(printf, 2, 3) -__fh_access(read_write, 1) +__fh_access(write_only, 1) __fh_access(read_only, 2) _FORTIFY_FN(sprintf) int sprintf(char *__s, const char *__f, ...) { -- cgit v1.3