netfilter: ipset: off by one in ip_set_nfnl_get_byindex()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Oct 2014 08:28:12 +0000 (11:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:14 +0000 (09:23 -0800)
commit2e88ad96411623ce286794defd1c41a8a9b5802a
tree95224a2990a2e2cab4e8fcafca58a9be989790ed
parentef41fd5c6eb1e0ffc2653f02b28c7306bdc629ff
netfilter: ipset: off by one in ip_set_nfnl_get_byindex()

commit 0f9f5e1b83abd2b37c67658e02a6fc9001831fa5 upstream.

The ->ip_set_list[] array is initialized in ip_set_net_init() and it
has ->ip_set_max elements so this check should be >= instead of >
otherwise we are off by one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipset/ip_set_core.c