summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-07 08:37:50 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-07 08:37:50 +0000
commit3da752c32baa37ea278671f349930f2630c65fde (patch)
tree0c5e7cffee4741e59f8f661b73baa6a878ef6fdf
parentc2d1caa53ea83c8b3a8992ee9c52b97719e0325c (diff)
Don't try to dereference null configuration.
Fix from merith at redmoon dot openbsd dot de.
-rw-r--r--usr.sbin/ifstated/ifstated.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c
index 7782185e642..9ffbc1c3f05 100644
--- a/usr.sbin/ifstated/ifstated.c
+++ b/usr.sbin/ifstated/ifstated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifstated.c,v 1.12 2004/02/26 11:52:59 henning Exp $ */
+/* $OpenBSD: ifstated.c,v 1.13 2004/03/07 08:37:49 mcbride Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
@@ -593,7 +593,7 @@ clear_config(struct ifsd_config *oconf)
struct ifsd_state *state;
external_evtimer_setup(&conf->always, IFSD_EVTIMER_DEL);
- if (conf->curstate != NULL)
+ if (conf != NULL && conf->curstate != NULL)
external_evtimer_setup(conf->curstate, IFSD_EVTIMER_DEL);
while ((state = TAILQ_FIRST(&oconf->states)) != NULL) {
TAILQ_REMOVE(&oconf->states, state, entries);
@@ -686,7 +686,7 @@ logit(int level, const char *fmt, ...)
va_list ap;
char *nfmt;
- if (level > conf->loglevel)
+ if (conf == NULL || level > conf->loglevel)
return;
va_start(ap, fmt);