]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: Fix null pointer access (coverity 1472311) 2812/head
authorEmanuele Di Pascale <emanuele@voltanet.io>
Thu, 9 Aug 2018 12:26:55 +0000 (14:26 +0200)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Thu, 9 Aug 2018 12:26:55 +0000 (14:26 +0200)
Aded a check to ensure that if_is_vrf() is not called on a NULL if pointer.
Incidentally this was causing PR #2805 to fail.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
staticd/static_zebra.c

index 27e126e2a6419ef5f1ba800b48bf3592e7e84f58..f3175e91faf3569e7f6e80be66020a5b78b1383a 100644 (file)
@@ -119,7 +119,7 @@ static int interface_state_up(int command, struct zclient *zclient,
 
        ifp = zebra_interface_if_lookup(zclient->ibuf);
 
-       if (if_is_vrf(ifp)) {
+       if (ifp && if_is_vrf(ifp)) {
                struct static_vrf *svrf = static_vrf_lookup_by_id(vrf_id);
 
                static_fixup_vrf_ids(svrf);