From 7f859d49b753b0b09696b213c3fe22f67103b315 Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 26 Jul 2002 16:27:57 +0000 Subject: check for invalid port ranges (Thomas Poehnitz) --- extensions/libipt_udp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'extensions/libipt_udp.c') diff --git a/extensions/libipt_udp.c b/extensions/libipt_udp.c index 622fb43..ccea210 100644 --- a/extensions/libipt_udp.c +++ b/extensions/libipt_udp.c @@ -69,6 +69,10 @@ parse_udp_ports(const char *portstring, u_int16_t *ports) ports[0] = buffer[0] ? parse_udp_port(buffer) : 0; ports[1] = cp[0] ? parse_udp_port(cp) : 0xFFFF; + + if (ports[0] > ports[1]) + exit_error(PARAMETER_PROBLEM, + "invalid portrange (min > max)"); } free(buffer); } -- cgit v1.2.3