aboutsummaryrefslogtreecommitdiff
path: root/sbin/routed
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-05-14 23:32:03 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-05-14 23:32:03 +0000
commit5728318b3572cd99692e8ed3b367ee21f107f1df (patch)
tree03b1952879e374236f7df0565513a2fef3ef6ef4 /sbin/routed
parent4a2b63d5bb8d0a3d3a8a13728a2882ee456d078d (diff)
downloadsrc-5728318b3572cd99692e8ed3b367ee21f107f1df.tar.gz
src-5728318b3572cd99692e8ed3b367ee21f107f1df.zip
Avoid NULL de-references.
CID: 271079 Obtained from: NetBSD MFC after: 2 weeks.
Notes
Notes: svn path=/head/; revision=299784
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 e3bee7a60971..4a9c5a214d1d 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;