summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_udp.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2002-03-14 11:35:58 +0000
committerHarald Welte <laforge@gnumonks.org>2002-03-14 11:35:58 +0000
commitb77f1dafb9f35752bb9685323bcacb32a0e6ddc5 (patch)
tree32821b41042796995881aabc74f6821e7603b288 /extensions/libipt_udp.c
parentdffa8ddb43ca2d5bfe7344daea2f6e80c5adaa58 (diff)
Fix 'iptables -p !' bug (segfault when `!' used without argument)
Diffstat (limited to 'extensions/libipt_udp.c')
-rw-r--r--extensions/libipt_udp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/extensions/libipt_udp.c b/extensions/libipt_udp.c
index 3db35b1b..6b6b9961 100644
--- a/extensions/libipt_udp.c
+++ b/extensions/libipt_udp.c
@@ -100,8 +100,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
if (*flags & UDP_SRC_PORTS)
exit_error(PARAMETER_PROBLEM,
"Only one `--source-port' allowed");
- if (check_inverse(optarg, &invert))
- optind++;
+ check_inverse(optarg, &invert, &optind, 0);
parse_udp_ports(argv[optind-1], udpinfo->spts);
if (invert)
udpinfo->invflags |= IPT_UDP_INV_SRCPT;
@@ -113,8 +112,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
if (*flags & UDP_DST_PORTS)
exit_error(PARAMETER_PROBLEM,
"Only one `--destination-port' allowed");
- if (check_inverse(optarg, &invert))
- optind++;
+ check_inverse(optarg, &invert, &optind, 0);
parse_udp_ports(argv[optind-1], udpinfo->dpts);
if (invert)
udpinfo->invflags |= IPT_UDP_INV_DSTPT;