Prevent dereferencing a NULL route pointer when trying to update the

route MTU.

This bug is very difficult to reach and not remotely exploitable.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID162
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
This commit is contained in:
Andre Oppermann 2006-01-18 15:05:05 +00:00
parent 4e7ba1ab94
commit 39550088cf

View File

@ -790,7 +790,8 @@ passout:
* them, there is no way for one to update all its
* routes when the MTU is changed.
*/
if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
if (ro != NULL &&
(ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
(ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
}