From 2d79b311e4211e414e377b8641d53726e27578b9 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 22 Jul 2010 17:16:45 +0000 Subject: [PATCH] Don't deref a NULL pointer if tap or tag are not specified in the config file. --- sbin/iked/parse.y | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index 8c7e6e5fa72..a5d9b7db4f1 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.9 2010/07/01 02:15:08 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.10 2010/07/22 17:16:45 jsg Exp $ */ /* $vantronix: parse.y,v 1.22 2010/06/03 11:08:34 reyk Exp $ */ /* @@ -2199,9 +2199,11 @@ create_ike(char *name, u_int8_t ipproto, struct ipsec_hosts *hosts, } } - if (filter->tag) - strlcpy(pol.pol_tag, filter->tag, sizeof(pol.pol_tag)); - pol.pol_tap = filter->tap; + if (filter != NULL) { + if (filter->tag) + strlcpy(pol.pol_tag, filter->tag, sizeof(pol.pol_tag)); + pol.pol_tap = filter->tap; + } if (peers == NULL) { if (pol.pol_flags & IKED_POLICY_ACTIVE) { -- 2.20.1