]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix crash with dereference of NULL pointer
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Apr 2017 12:42:18 +0000 (08:42 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Apr 2017 17:26:56 +0000 (13:26 -0400)
We only create the v4 and v6 mpls fec tables currently.
Follow the code pattern for the rest of the code and
ensure that the table exists before we attempt to access it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_mpls.c

index 42738f8fb9c1f8670b8bbe8145c116c164bac528..76263024c5416b789e94d1edc0fddca8851efe8a 100644 (file)
@@ -372,6 +372,9 @@ fec_evaluate (struct zebra_vrf *zvrf, int add)
 
   for (af = AFI_IP; af < AFI_MAX; af++)
     {
+      if (zvrf->fec_table[af] == NULL)
+        continue;
+
       for (rn = route_top(zvrf->fec_table[af]); rn; rn = route_next(rn))
         {
           if ((fec = rn->info) == NULL)