summaryrefslogtreecommitdiffstats
path: root/libxtables
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-09-24 19:25:21 +0200
committerFlorian Westphal <fw@strlen.de>2018-09-25 16:26:08 +0200
commita3716cc1a501e40e26a96d78b2e1285bb081f366 (patch)
tree1da1bac47fcaa4abe3b66b2cc429ddc15160f84f /libxtables
parent0195b6428fbd2f8e1223e5933a41e22c14e05988 (diff)
libxtables: Check extension real_name length
Just like with 'name', if given check 'real_name' to not exceed max length. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'libxtables')
-rw-r--r--libxtables/xtables.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libxtables/xtables.c b/libxtables/xtables.c
index 6dd0b152..34a084f4 100644
--- a/libxtables/xtables.c
+++ b/libxtables/xtables.c
@@ -920,6 +920,12 @@ void xtables_register_match(struct xtables_match *me)
exit(1);
}
+ if (me->real_name && strlen(me->real_name) >= XT_EXTENSION_MAXNAMELEN) {
+ fprintf(stderr, "%s: match `%s' has invalid real name\n",
+ xt_params->program_name, me->real_name);
+ exit(1);
+ }
+
if (me->family >= NPROTO) {
fprintf(stderr,
"%s: BUG: match %s has invalid protocol family\n",
@@ -1107,6 +1113,12 @@ void xtables_register_target(struct xtables_target *me)
exit(1);
}
+ if (me->real_name && strlen(me->real_name) >= XT_EXTENSION_MAXNAMELEN) {
+ fprintf(stderr, "%s: target `%s' has invalid real name\n",
+ xt_params->program_name, me->real_name);
+ exit(1);
+ }
+
if (me->family >= NPROTO) {
fprintf(stderr,
"%s: BUG: target %s has invalid protocol family\n",