summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2002-08-12 19:36:04 +0000
committerdhartmei <dhartmei@openbsd.org>2002-08-12 19:36:04 +0000
commite3fcaf8f2490344707c6afd6804aa51d10828c48 (patch)
tree8fed98512d82c0726973dab5043ea5e9c078561f
parentmore PermitUserEnvironment; ok markus@ (diff)
downloadwireguard-openbsd-e3fcaf8f2490344707c6afd6804aa51d10828c48.tar.xz
wireguard-openbsd-e3fcaf8f2490344707c6afd6804aa51d10828c48.zip
Catch null pointer deref (segfault), from wilfried@
-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;
+ }
}
;