diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-09-19 22:31:04 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-09-23 03:30:43 -0400 |
commit | b9d80f83bf8c3485ae53a4f3a715363d764bb0e4 (patch) | |
tree | f7c71f7232436811f9f051dfd606b5ff71ac374e | |
parent | 7bdc66242de7f9cbe8dbb01757042dd18744d800 (diff) |
netfilter: xt_helper: Use sizeof(variable) instead of literal number
It's better to use sizeof(info->name)-1 as index to force set the string
tail instead of literal number '29'.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/xt_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c index 9f4ab00c8050..805c9f64a04c 100644 --- a/net/netfilter/xt_helper.c +++ b/net/netfilter/xt_helper.c | |||
@@ -65,7 +65,7 @@ static int helper_mt_check(const struct xt_mtchk_param *par) | |||
65 | par->family); | 65 | par->family); |
66 | return ret; | 66 | return ret; |
67 | } | 67 | } |
68 | info->name[29] = '\0'; | 68 | info->name[sizeof(info->name) - 1] = '\0'; |
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||