summaryrefslogtreecommitdiff
path: root/sys/net/pf_if.c
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2004-12-06 10:38:20 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2004-12-06 10:38:20 +0000
commit1834ef8c346155f51aa60a04f20fb21922d260b5 (patch)
tree431b38681db543bf5d3dcc1105f504d25aed6de4 /sys/net/pf_if.c
parent16c406400f665204972e9e16905be5a4f75e3dfb (diff)
Check a NULL dereference before it could happen.
ok mcbride@
Diffstat (limited to 'sys/net/pf_if.c')
-rw-r--r--sys/net/pf_if.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index f7dd3500a1c..5189646b9df 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.20 2004/08/15 15:31:46 henning Exp $ */
+/* $OpenBSD: pf_if.c,v 1.21 2004/12/06 10:38:19 mpf Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -349,11 +349,14 @@ void
pfi_dynaddr_update(void *p)
{
struct pfi_dynaddr *dyn = (struct pfi_dynaddr *)p;
- struct pfi_kif *kif = dyn->pfid_kif;
- struct pfr_ktable *kt = dyn->pfid_kt;
+ struct pfi_kif *kif;
+ struct pfr_ktable *kt;
- if (dyn == NULL || kif == NULL || kt == NULL)
+ if (dyn == NULL || dyn->pfid_kif == NULL || dyn->pfid_kt == NULL)
panic("pfi_dynaddr_update");
+
+ kif = dyn->pfid_kif;
+ kt = dyn->pfid_kt;
if (kt->pfrkt_larg != pfi_update) {
/* this table needs to be brought up-to-date */
pfi_table_update(kt, kif, dyn->pfid_net, dyn->pfid_iflags);