1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Avoid NULL de-references.

CID:		271079
Obtained from:	NetBSD
MFC after:	2 weeks.
This commit is contained in:
Pedro F. Giffuni 2016-05-14 23:32:03 +00:00
parent 4a2b63d5bb
commit 5728318b35
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299784

View File

@ -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;