summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-11-23 08:12:57 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-11-23 08:12:57 +0000
commit03dcaff4477e78f98c6117774d1608809c0ab088 (patch)
tree194b7839ef4b653b0a237c786a83669179260740 /sbin
parentdbe3645872407b07d865738ccd9ede434f97183a (diff)
check to make sure a list item exists before checking to see if the next
one is there. ok dhartmei@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/pfctl_parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 62b7cb85fd2..288fe535685 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.107 2002/11/23 06:18:42 mcbride Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.108 2002/11/23 08:12:56 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -400,7 +400,8 @@ print_pool(struct pf_pool *pool, sa_family_t af, int id)
{
struct pf_pooladdr *pooladdr;
- if (TAILQ_NEXT(TAILQ_FIRST(&pool->list), entries) != NULL)
+ if ((TAILQ_FIRST(&pool->list) != NULL) &&
+ TAILQ_NEXT(TAILQ_FIRST(&pool->list), entries) != NULL)
printf("{ ");
TAILQ_FOREACH(pooladdr, &pool->list, entries){
switch (id) {