Skip to content
Commit 161b838e authored by Colin Ian King's avatar Colin Ian King Committed by Pablo Neira Ayuso
Browse files

netfilter: nftables: fix incorrect increment of loop counter

The intention of the err_expr cleanup path is to iterate over the
allocated expr_array objects and free them, starting from i - 1 and
working down to the start of the array. Currently the loop counter
is being incremented instead of decremented and also the index i is
being used instead of k, repeatedly destroying the same expr_array
element.  Fix this by decrementing k and using k as the index into
expr_array.

Addresses-Coverity: ("Infinite loop")
Fixes: 8cfd9b0f

 ("netfilter: nftables: generalize set expressions support")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 3db1a3fa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment