summaryrefslogtreecommitdiffstats
path: root/iptables/nft-ipv6.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-04-07 23:21:23 +0200
committerFlorian Westphal <fw@strlen.de>2018-04-08 23:18:16 +0200
commiteb358546b04c57a60c023744e815dea173733370 (patch)
tree2eb06bf674230cdeacb0fdda72242d839aad3eb3 /iptables/nft-ipv6.c
parentfc04c8a7c78dc0476b2d1ef4178f0a0cdf638c65 (diff)
xtables-compat: fix snprintf truncation warnings
proto is u16 in the data structure, so this gave: nft-ipv6.c:422:44: warning: '__builtin___snprintf_chk' output may be truncated before the last format character [-Wformat-truncation=] Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft-ipv6.c')
-rw-r--r--iptables/nft-ipv6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c
index 9867d1ee..1be49dd3 100644
--- a/iptables/nft-ipv6.c
+++ b/iptables/nft-ipv6.c
@@ -416,7 +416,7 @@ static int nft_ipv6_xlate(const void *data, struct xt_xlate *xl)
if (cs->fw6.ipv6.proto != 0) {
const struct protoent *pent =
getprotobynumber(cs->fw6.ipv6.proto);
- char protonum[strlen("255") + 1];
+ char protonum[sizeof("65535")];
if (!xlate_find_match(cs, pent->p_name)) {
snprintf(protonum, sizeof(protonum), "%u",