]> git.ipfire.org Git - thirdparty/iptables.git/commit
libxt_string: Avoid potential array out of bounds access
authorPhil Sutter <phil@nwl.cc>
Mon, 10 Sep 2018 21:35:16 +0000 (23:35 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 13 Sep 2018 08:48:11 +0000 (10:48 +0200)
commit56d7ab42f37829ab8d42f34b77fd630ce08f5a7c
tree00d7802be6e6b27f94118f094bc0c3dc85f48a0c
parentbfd41c8d99a54769678e0c66d55797082bf1edd3
libxt_string: Avoid potential array out of bounds access

The pattern index variable 'sindex' is bounds checked before
incrementing it, which means in the next loop iteration it might already
match the bounds check condition but is used anyway.

Fix this by incrementing the index before performing the bounds check.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
extensions/libxt_string.c