]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
path: Sanitize format strings for the format function
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 17:55:25 +0000 (17:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 17:55:25 +0000 (17:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/path.h

index 6ee180d3d43168e88c7f08256d7a017caa7814c5..77ce9f23e1f06b06f345e60b9987c6cb361f61f3 100644 (file)
@@ -30,7 +30,8 @@ int __pakfire_path_normalize(char* p, const size_t length);
 
 #define pakfire_path_format(path, format, ...) \
        __pakfire_path_format(path, sizeof(path), format, __VA_ARGS__)
-int __pakfire_path_format(char* buffer, const size_t length, const char* format, ...);
+int __pakfire_path_format(char* buffer, const size_t length, const char* format, ...)
+       __attribute__((format(printf, 3, 4)));;
 
 #define pakfire_path_append(path, s1, s2) \
        __pakfire_path_append(path, sizeof(path), s1, s2)