]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: flag invalid uses of XTOPT_PUT
authorJan Engelhardt <jengelh@medozas.de>
Thu, 5 May 2011 10:53:14 +0000 (12:53 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 8 May 2011 22:45:18 +0000 (00:45 +0200)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtoptions.c

index f8031bbe8c03b4bc5bef108a9e6052c5ab8db34d..29d05d5352b32f4335e1d276fb2d254de1319fd3 100644 (file)
@@ -708,7 +708,8 @@ void xtables_option_metavalidate(const char *name,
                                name, entry->id);
                if (!(entry->flags & XTOPT_PUT))
                        continue;
-               if (entry->type >= ARRAY_SIZE(xtopt_psize))
+               if (entry->type >= ARRAY_SIZE(xtopt_psize) ||
+                   xtopt_psize[entry->type] == 0)
                        xt_params->exit_err(OTHER_PROBLEM,
                                "%s: entry type of option \"--%s\" cannot be "
                                "combined with XTOPT_PUT\n",