summaryrefslogtreecommitdiffstats
path: root/sbin/routed
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-05-14 23:32:03 +0000
committerpfg <pfg@FreeBSD.org>2016-05-14 23:32:03 +0000
commite5af8e55f1fbbab982031713359312533d7b0db4 (patch)
tree03b1952879e374236f7df0565513a2fef3ef6ef4 /sbin/routed
parent1f91765207fc32edc0a7bd3ce16ea30136bce888 (diff)
downloadFreeBSD-src-e5af8e55f1fbbab982031713359312533d7b0db4.zip
FreeBSD-src-e5af8e55f1fbbab982031713359312533d7b0db4.tar.gz
Avoid NULL de-references.
CID: 271079 Obtained from: NetBSD MFC after: 2 weeks.
Diffstat (limited to 'sbin/routed')
-rw-r--r--sbin/routed/output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/routed/output.c b/sbin/routed/output.c
index e3bee7a..4a9c5a2 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;
OpenPOWER on IntegriCloud