]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ip[6]tables: only call target's parse function when option char is in range
authorJan Engelhardt <jengelh@medozas.de>
Sat, 8 Jan 2011 01:47:02 +0000 (02:47 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 8 Jan 2011 01:47:02 +0000 (02:47 +0100)
Same as previous commit. Doing this actually allows to remove code
that is no longer needed.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
ip6tables.c
iptables.c

index 4ca4bfeca089de9c1497541e667bab468fd0f2cf..d4c2339b1d541315b0a21626d5ca8b3c81bb98fa 100644 (file)
@@ -1706,6 +1706,8 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
                default:
                        if (target == NULL || target->parse == NULL ||
+                           c < target->option_offset ||
+                           c >= target->option_offset + XT_OPTION_OFFSET_SCALE ||
                            !target->parse(c - target->option_offset,
                                               argv, invert,
                                               &target->tflags,
index bcacd49f29137c32b21ea3bc2f6405bdbd34d160..b45211a982681321aa47c65e96fe1ed1c6d6b37d 100644 (file)
@@ -1738,6 +1738,8 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
                default:
                        if (target == NULL || target->parse == NULL ||
+                           c < target->option_offset ||
+                           c >= target->option_offset + XT_OPTION_OFFSET_SCALE ||
                            !target->parse(c - target->option_offset,
                                               argv, invert,
                                               &target->tflags,