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 <morgan@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit c8394ace7081ef0e71f3d162067c83c2629fc088)
This commit is contained in:
Morgan Stewart 2015-09-17 19:04:30 -04:00 committed by Daniel Walton
parent a5c304ab35
commit 06b420a4d7

View File

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