summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-09 19:07:22 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-09 19:07:22 +0000
commit639fb7626d3306f86850a074d8b53cf57a307e19 (patch)
tree171ae1cfb5b70ebddb83c8d8c2a53de2d39ca446 /sbin
parentf8fedce081a30f00310cc6ef4be38bdb063c046c (diff)
cope with LOOP_THROUGH modifying the lis (queues).
in case of an error in the queue def in question the queues list remains unmodified, but the LOOP_THROUGH caused a mod anyway, and the list can stay empty. subsequent checks for NULL which check for a empty list fail then. fix by adding an explicit check before looping. fixes regress pfail31 error report by Kamil Andrusz via pb@, testcase from pb@ ok dhartmei@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 1afae54beb6..0550e00acc6 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.339 2003/03/09 18:58:25 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.340 2003/03/09 19:07:21 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -3145,6 +3145,12 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues,
return (0);
}
+ if (queues == NULL) {
+ yyerror("queue has no parent");
+ FREE_LIST(struct node_queue, nqueues);
+ return (1);
+ }
+
LOOP_THROUGH(struct node_queue, tqueue, queues,
if (!strncmp(a->qname, tqueue->queue, PF_QNAME_SIZE)) {
/* found ourselve in queues */