summaryrefslogtreecommitdiffstats
path: root/libxtables
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-09-10 23:35:13 +0200
committerFlorian Westphal <fw@strlen.de>2018-09-13 10:47:42 +0200
commit4144571f87c094471419ef59e8bb89ef33cd1365 (patch)
tree78f5050c80dddea7339ddf5a570b8640c96a8922 /libxtables
parent9242b5d9341434a5ae1491f64802df6926340d20 (diff)
libxtables: Fix potential array overrun in xtables_option_parse()
If entry->type is to be used as array index, it needs to be at max one less than that array's size. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'libxtables')
-rw-r--r--libxtables/xtoptions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
index ba3128bd..326febd5 100644
--- a/libxtables/xtoptions.c
+++ b/libxtables/xtoptions.c
@@ -844,7 +844,7 @@ void xtables_option_parse(struct xt_option_call *cb)
* a *RC option type.
*/
cb->nvals = 1;
- if (entry->type <= ARRAY_SIZE(xtopt_subparse) &&
+ if (entry->type < ARRAY_SIZE(xtopt_subparse) &&
xtopt_subparse[entry->type] != NULL)
xtopt_subparse[entry->type](cb);
/* Exclusion with other flags tested later in finalize. */