summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-04-17 16:36:41 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-04-17 16:36:41 +0000
commitae00f72e6779794de9a4dbdb6e213236f334a872 (patch)
treed6718f16887ae5ac130bb31f3d87c902f5b7bde0 /usr.sbin/bgpd
parentb8d4f611a46d77ff1d2e46b5a410cb7451ffa150 (diff)
fix null pointer deref on filter rules without set part
problem reported by "Alexey E. Suslikov" <cruel@texnika.com.ua>
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index ea65f2c9053..8b5b8224155 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.159 2005/04/13 21:16:22 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.160 2005/04/17 16:36:40 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2105,7 +2105,7 @@ expand_rule(struct filter_rule *rule, struct filter_peers_l *peer,
free(a);
}
- while ((s = SIMPLEQ_FIRST(set)) != NULL) {
+ while (set != NULL && (s = SIMPLEQ_FIRST(set)) != NULL) {
SIMPLEQ_REMOVE_HEAD(set, entry);
free(s);
}