projects
/
platform
/
kernel
/
linux-rpi3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7bdc662
)
netfilter: xt_helper: Use sizeof(variable) instead of literal number
author
Gao Feng
<fgao@ikuai8.com>
Tue, 20 Sep 2016 02:31:04 +0000
(10:31 +0800)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Fri, 23 Sep 2016 07:30:43 +0000
(09:30 +0200)
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>
net/netfilter/xt_helper.c
patch
|
blob
|
history
diff --git
a/net/netfilter/xt_helper.c
b/net/netfilter/xt_helper.c
index
9f4ab00
..
805c9f6
100644
(file)
--- 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;
}