]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fixed if_add_update possible null dereference
authorMorgan Stewart <morgan@cumulusnetworks.com>
Thu, 17 Sep 2015 23:04:30 +0000 (19:04 -0400)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:32 +0000 (15:33 +0000)
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)

zebra/interface.c

index 68f7ba3f540c2319b654c3c43646719cc71f280d..f3bd3eb46c732d4c43196b48a663607a874b87f5 100644 (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)