]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Fix for potential array boundary overstep
authorPhil Sutter <phil@nwl.cc>
Mon, 10 Sep 2018 21:35:15 +0000 (23:35 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 13 Sep 2018 08:47:59 +0000 (10:47 +0200)
Fix the parameter check in nft_ebt_standard_target() to avoid an array
out of bounds access in ebt_standard_targets.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-bridge.h

index 1fe26bab4feb55efa3ce1e750515ef84e721c97c..9d49ccbef0961d8104274bf2990f3ba9adb2fee3 100644 (file)
@@ -78,7 +78,7 @@ static const char *ebt_standard_targets[NUM_STANDARD_TARGETS] = {
 
 static inline const char *nft_ebt_standard_target(unsigned int num)
 {
-       if (num > NUM_STANDARD_TARGETS)
+       if (num >= NUM_STANDARD_TARGETS)
                return NULL;
 
        return ebt_standard_targets[num];