summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-08-26 18:43:05 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2003-08-26 18:43:05 +0000
commitfa082f15c1b3abdb6d3208379c93668c246f2ad9 (patch)
tree5bb67fd145e6b632b8d3a40014c8990bf243da2e /sbin
parentf2d5905a6c105d43bcf8bcc9f34c4fdf240fc327 (diff)
catch port/user/group a <>/>< b with a >= b, from mpech@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 11a938ca078..a0821469c8d 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.412 2003/08/25 17:44:44 dhartmei Exp $ */
+/* $OpenBSD: parse.y,v 1.413 2003/08/26 18:43:04 dhartmei Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -1980,6 +1980,10 @@ port_item : port {
"port operator");
YYERROR;
}
+ if ($1.a >= $3.a) {
+ yyerror("port arguments invalid");
+ YYERROR;
+ }
$$ = calloc(1, sizeof(struct node_port));
if ($$ == NULL)
err(1, "port_item: calloc");
@@ -2073,6 +2077,10 @@ uid_item : uid {
"!=");
YYERROR;
}
+ if ($1 >= $3) {
+ yyerror("user arguments invalid");
+ YYERROR;
+ }
$$ = calloc(1, sizeof(struct node_uid));
if ($$ == NULL)
err(1, "uid_item: calloc");
@@ -2152,6 +2160,10 @@ gid_item : gid {
"!=");
YYERROR;
}
+ if ($1 >= $3) {
+ yyerror("group arguments invalid");
+ YYERROR;
+ }
$$ = calloc(1, sizeof(struct node_gid));
if ($$ == NULL)
err(1, "gid_item: calloc");