From: Donald Sharp Date: Sat, 15 Apr 2017 12:42:18 +0000 (-0400) Subject: zebra: Fix crash with dereference of NULL pointer X-Git-Tag: reindent-master-before~213^2~9 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=95169c2f785d09aebd6c0e25bf311ecc185fb61a;p=matthieu%2Ffrr.git zebra: Fix crash with dereference of NULL pointer 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 --- diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 42738f8fb9..76263024c5 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -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)