netfilter: nftables: Add __printf() attribute
authorAndrew Lunn <andrew@lunn.ch>
Sat, 31 Oct 2020 18:21:44 +0000 (19:21 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 1 Nov 2020 10:50:32 +0000 (11:50 +0100)
nft_request_module calls vsnprintf() using parameters passed to it.
Make the function with __printf() attribute so the compiler can check
the format and arguments.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index 65cb8e3..522a9d2 100644 (file)
@@ -581,7 +581,8 @@ struct nft_module_request {
 };
 
 #ifdef CONFIG_MODULES
-static int nft_request_module(struct net *net, const char *fmt, ...)
+static __printf(2, 3) int nft_request_module(struct net *net, const char *fmt,
+                                            ...)
 {
        char module_name[MODULE_NAME_LEN];
        struct nft_module_request *req;