summaryrefslogtreecommitdiffstats
path: root/include/stdio.h
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-04-17 07:59:52 +0000
committerkris <kris@FreeBSD.org>2001-04-17 07:59:52 +0000
commit0f958ee7467ce3cd3eaedbef81be48790d0b6b1a (patch)
tree3a26f765580b87bb8dbbe23a52082eaf344945c5 /include/stdio.h
parentb6da0fca774d229c4776e41d019373d1ec0df7ab (diff)
downloadFreeBSD-src-0f958ee7467ce3cd3eaedbef81be48790d0b6b1a.zip
FreeBSD-src-0f958ee7467ce3cd3eaedbef81be48790d0b6b1a.tar.gz
Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or otherwise difficult to verify statically. Example usage: printf(fmtcheck(user_format, standard_format), arg1, arg2); checks the format string user_format for consistency (same number/order/ type of format operators) with standard_format. If they differ, standard_format is used instead to avoid potential crashes or security violations. Obtained from: NetBSD Reviewed by: -arch
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index e8c346b..520c622 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -299,6 +299,8 @@ __END_DECLS
__BEGIN_DECLS
int asprintf __P((char **, const char *, ...)) __printflike(2, 3);
char *ctermid_r __P((char *));
+const char *fmtcheck __P((const char *, const char *))
+ __attribute__((__format_arg__(2)));
char *fgetln __P((FILE *, size_t *));
int fpurge __P((FILE *));
int fseeko __P((FILE *, _BSD_OFF_T_, int));
OpenPOWER on IntegriCloud