diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-29 17:14:19 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-29 17:14:19 +0000 |
commit | 0bf41fc2016c3e8b2424d4369f6c4b3537e42c25 (patch) | |
tree | 2682549e6cace1e37fd4f67f97befc0d8ca21349 /sbin | |
parent | 49f2b5fe9e3a6e3c7b185732447b2fc05190c9c7 (diff) |
coredumps are not nice.
deal with the fact that when we are merging the lists in host_list both can
be NULL.
found at EuroBSDCon 2002 while I was explaining the expansion process to
Paul de Weerd
ok dhartmei@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index f1c353a6959..af86299f944 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.227 2002/11/29 15:37:23 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.228 2002/11/29 17:14:18 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -1021,9 +1021,15 @@ ipspec : ANY { $$ = NULL; } host_list : xhost { $$ = $1; } | host_list comma xhost { /* $3 may be a list, so use its tail pointer */ - $1->tail->next = $3->tail; - $1->tail = $3->tail; - $$ = $1; + if ($3 == NULL) + $$ = $1; + else if ($1 == NULL) + $$ = $3; + else { + $1->tail->next = $3->tail; + $1->tail = $3->tail; + $$ = $1; + } } ; |