]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd pimd: null check (PVS-Studio) 2605/head
authorF. Aragon <paco@voltanet.io>
Mon, 2 Jul 2018 15:44:58 +0000 (17:44 +0200)
committerF. Aragon <paco@voltanet.io>
Thu, 5 Jul 2018 22:49:24 +0000 (00:49 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
ospfd/ospf_ase.c
pimd/pim_mroute.c

index c799a4b30f9840e4bbb65f6a4934075af9ce6ada..d84fd26ac4af74b90d1e3f2640d9ed907cae964e 100644 (file)
@@ -543,7 +543,7 @@ static int ospf_ase_route_match_same(struct route_table *rt,
                                     struct ospf_route *newor)
 {
        struct route_node *rn;
-       struct ospf_route * or ;
+       struct ospf_route *or;
        struct ospf_path *op;
        struct ospf_path *newop;
        struct listnode *n1;
@@ -559,6 +559,9 @@ static int ospf_ase_route_match_same(struct route_table *rt,
        route_unlock_node(rn);
 
        or = rn->info;
+
+       assert(or);
+
        if (or->path_type != newor->path_type)
                return 0;
 
@@ -577,6 +580,8 @@ static int ospf_ase_route_match_same(struct route_table *rt,
                return 0;
        }
 
+       assert(or->paths);
+
        if (or->paths->count != newor->paths->count)
                return 0;
 
index c7e1a18d280b70731d6b2069a7d1d444e5f219c8..dd306784055a04d0bbc0e9a0b50c7914f268f187 100644 (file)
@@ -158,7 +158,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,
         * the Interface type is SSM we don't need to
         * do anything here
         */
-       if ((pim_rpf_addr_is_inaddr_none(rpg)) || (!pim_ifp)
+       if (!rpg || (pim_rpf_addr_is_inaddr_none(rpg))
            || (!(PIM_I_am_DR(pim_ifp)))) {
                if (PIM_DEBUG_MROUTE_DETAIL)
                        zlog_debug(