From 5728318b3572cd99692e8ed3b367ee21f107f1df Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 23:32:03 +0000 Subject: [PATCH] Avoid NULL de-references. CID: 271079 Obtained from: NetBSD MFC after: 2 weeks. --- sbin/routed/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/routed/output.c b/sbin/routed/output.c index e3bee7a6097..4a9c5a214d1 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -711,7 +711,7 @@ supply(struct sockaddr_in *dst, switch (type) { case OUT_MULTICAST: - if (ifp->int_if_flags & IFF_MULTICAST) + if (ifp != NULL && ifp->int_if_flags & IFF_MULTICAST) v2buf.type = OUT_MULTICAST; else v2buf.type = NO_OUT_MULTICAST; @@ -757,7 +757,7 @@ supply(struct sockaddr_in *dst, /* Fake a default route if asked and if there is not already * a better, real default route. */ - if (supplier && (def_metric = ifp->int_d_metric) != 0) { + if (supplier && ifp && (def_metric = ifp->int_d_metric) != 0) { if ((rt = rtget(RIP_DEFAULT, 0)) == NULL || rt->rt_metric+ws.metric >= def_metric) { ws.state |= WS_ST_DEFAULT;