|
|
43df5c |
From f958c3a78f14140e7ee983c3698918fe35f1a7af Mon Sep 17 00:00:00 2001
|
|
|
43df5c |
From: Phil Sutter <psutter@redhat.com>
|
|
|
43df5c |
Date: Fri, 15 Mar 2019 17:50:10 +0100
|
|
|
43df5c |
Subject: [PATCH] libxtables: Fix potential array overrun in
|
|
|
43df5c |
xtables_option_parse()
|
|
|
43df5c |
|
|
|
43df5c |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1525980
|
|
|
43df5c |
Upstream Status: iptables commit 4144571f87c09
|
|
|
43df5c |
|
|
|
43df5c |
commit 4144571f87c094471419ef59e8bb89ef33cd1365
|
|
|
43df5c |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
43df5c |
Date: Mon Sep 10 23:35:13 2018 +0200
|
|
|
43df5c |
|
|
|
43df5c |
libxtables: Fix potential array overrun in xtables_option_parse()
|
|
|
43df5c |
|
|
|
43df5c |
If entry->type is to be used as array index, it needs to be at max one
|
|
|
43df5c |
less than that array's size.
|
|
|
43df5c |
|
|
|
43df5c |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
43df5c |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
43df5c |
|
|
|
43df5c |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
43df5c |
---
|
|
|
43df5c |
libxtables/xtoptions.c | 2 +-
|
|
|
43df5c |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
43df5c |
|
|
|
43df5c |
diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
|
|
|
43df5c |
index 78e9abd6a3f47..0c63c2d372dea 100644
|
|
|
43df5c |
--- a/libxtables/xtoptions.c
|
|
|
43df5c |
+++ b/libxtables/xtoptions.c
|
|
|
43df5c |
@@ -864,7 +864,7 @@ void xtables_option_parse(struct xt_option_call *cb)
|
|
|
43df5c |
* a *RC option type.
|
|
|
43df5c |
*/
|
|
|
43df5c |
cb->nvals = 1;
|
|
|
43df5c |
- if (entry->type <= ARRAY_SIZE(xtopt_subparse) &&
|
|
|
43df5c |
+ if (entry->type < ARRAY_SIZE(xtopt_subparse) &&
|
|
|
43df5c |
xtopt_subparse[entry->type] != NULL)
|
|
|
43df5c |
xtopt_subparse[entry->type](cb);
|
|
|
43df5c |
/* Exclusion with other flags tested later in finalize. */
|
|
|
43df5c |
--
|
|
|
43df5c |
2.21.0
|
|
|
43df5c |
|