From: Morgan Stewart Date: Thu, 17 Sep 2015 23:04:30 +0000 (-0400) Subject: Fixed if_add_update possible null dereference X-Git-Tag: frr-2.0-rc1~716 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=06b420a4d75e662a49823c6495b4457eeb4c2591;p=mirror%2Ffrr.git Fixed if_add_update possible null dereference Coverity Scan #1221454 In zebra/interface.c if_data could be null dereferenced without early check. Signed-off-by: Morgan Stewart Reviewed-by: Donald Sharp (cherry picked from commit c8394ace7081ef0e71f3d162067c83c2629fc088) --- diff --git a/zebra/interface.c b/zebra/interface.c index 68f7ba3f54..f3bd3eb46c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -452,6 +452,8 @@ if_add_update (struct interface *ifp) if_link_per_ns(zebra_ns_lookup (NS_DEFAULT), ifp); if_data = ifp->info; + assert(if_data); + if (if_data->multicast == IF_ZEBRA_MULTICAST_ON) if_set_flags (ifp, IFF_MULTICAST); else if (if_data->multicast == IF_ZEBRA_MULTICAST_OFF)