From: Gao Feng Date: Tue, 20 Sep 2016 02:31:04 +0000 (+0800) Subject: netfilter: xt_helper: Use sizeof(variable) instead of literal number X-Git-Tag: Ubuntu-5.0.0-8.9~6368^2~67^2~20 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b9d80f83bf8c3485ae53a4f3a715363d764bb0e4;p=mirror_ubuntu-disco-kernel.git 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 Signed-off-by: Pablo Neira Ayuso --- 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) par->family); return ret; } - info->name[29] = '\0'; + info->name[sizeof(info->name) - 1] = '\0'; return 0; }