summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-24 03:05:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-24 03:05:35 +0000
commite35edeb5be60023e2814abf3dee0558576507c66 (patch)
tree2c8da3796a36bd7b0ae3ffc9dba001f93f4d62b6
parent10614dec81027012c57ac99aa3f73e563e271fbe (diff)
Bail out instead of core-dumping if we don't understand the port range operator; ws@netbsd
-rw-r--r--sbin/ipf/parse.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/ipf/parse.c b/sbin/ipf/parse.c
index b457d66f540..585ce01362a 100644
--- a/sbin/ipf/parse.c
+++ b/sbin/ipf/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.21 1998/09/15 09:55:45 pattonme Exp $ */
+/* $OpenBSD: parse.c,v 1.22 1998/11/24 03:05:34 deraadt Exp $ */
/*
* Copyright (C) 1993-1997 by Darren Reed.
*
@@ -40,7 +40,7 @@
#if !defined(lint)
static const char sccsid[] ="@(#)parse.c 1.44 6/5/96 (C) 1993-1996 Darren Reed";
-static const char rcsid[] = "@(#)$Id: parse.c,v 1.21 1998/09/15 09:55:45 pattonme Exp $";
+static const char rcsid[] = "@(#)$Id: parse.c,v 1.22 1998/11/24 03:05:34 deraadt Exp $";
#endif
extern struct ipopt_names ionames[], secclass[];
@@ -661,6 +661,11 @@ u_char *cp;
comp = FR_OUTRANGE;
else if (!strcmp(**seg, "><"))
comp = FR_INRANGE;
+ else {
+ fprintf(stderr,"unknown range operator (%s)\n",
+ **seg);
+ return -1;
+ }
(*seg)++;
*tp = portnum(**seg);
} else if (!strcmp(**seg, "=") || !strcasecmp(**seg, "eq"))