From 9abbe8cc136e7fbc69004df3f1de9d54c40d969d Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 17 Jun 2011 10:31:11 +0300 Subject: Use av_printf_format to check the usage of printf style functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps catching cases where the format string doesn't match what is passed in, or injection bugs where user data is passed in as format string. Signed-off-by: Martin Storsjö --- libavutil/avstring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavutil/avstring.h') diff --git a/libavutil/avstring.h b/libavutil/avstring.h index b40acf6ebb..44ed89d654 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -22,6 +22,7 @@ #define AVUTIL_AVSTRING_H #include +#include "attributes.h" /** * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to @@ -107,7 +108,7 @@ size_t av_strlcat(char *dst, const char *src, size_t size); * @return the length of the string that would have been generated * if enough space had been available */ -size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...); +size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4); /** * Convert a number to a av_malloced string. -- cgit v1.2.3