summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-08-12 19:36:05 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2002-08-12 19:36:05 +0000
commitc53b717016a9d35adeee32dba099ddd8ba56ea1c (patch)
tree0293a49676b473fa93a22c94f8a0301bd5aa6285 /sbin
parent0b3b8915329baf8fd5e3b94458395176c8e11e7f (diff)
Catch null pointer deref (segfault), from wilfried@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y16
1 files changed, 10 insertions, 6 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 7fb83b39dd9..12ffe00c63d 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.139 2002/08/06 13:43:33 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.140 2002/08/12 19:36:04 dhartmei Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -627,11 +627,15 @@ ipspec : ANY { $$ = NULL; }
host_list : xhost { $$ = $1; }
| host_list comma xhost {
- /* both $1 and $3 may be lists, so join them */
- $$ = $3;
- while ($3->next)
- $3 = $3->next;
- $3->next = $1;
+ if ($3 == NULL)
+ $$ = $1;
+ else {
+ /* both $1 and $3 may be lists, so join them */
+ $$ = $3;
+ while ($3->next)
+ $3 = $3->next;
+ $3->next = $1;
+ }
}
;