Fix possible NULL dereference in knexthop_validate().
authorclaudio <claudio@openbsd.org>
Wed, 3 Aug 2022 08:11:18 +0000 (08:11 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 3 Aug 2022 08:11:18 +0000 (08:11 +0000)
commit07e4740f85bb7e37ebff07421a133561825b178f
tree39054fc2e8ba0da9684525054bc70d88ce95f9ad
parent35ab205eb3d65024e0f3243a9aa5fd3c85bab8ee
Fix possible NULL dereference in knexthop_validate().

kroute_match() may return NULL so setting kn->ifindex should only
be done if the kroute is valid. Also set the ifindex to 0 in
kroute_detach_nexthop().
Based on a bigger diff which is OK tb@ and sthen@
usr.sbin/bgpd/kroute.c