[dev] New Defects reported by Coverity Scan for freerangerouting/frr
scan-admin at coverity.com
scan-admin at coverity.com
Mon Oct 16 22:36:03 EDT 2017
Hi,
Please find the latest report on new defect(s) introduced to freerangerouting/frr found with Coverity Scan.
9 new defect(s) introduced to freerangerouting/frr found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 9 of 9 defect(s)
** CID 1458175: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 391 in if_set_index()
________________________________________________________________________________________________________
*** CID 1458175: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 391 in if_set_index()
385
386 return if_create(name, vrf_id);
387 }
388
389 void if_set_index(struct interface *ifp, ifindex_t ifindex)
390 {
>>> CID 1458175: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "vrf" = null return value from "vrf_lookup_by_id".
391 struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
392
393 if (ifp->ifindex == ifindex)
394 return;
395
396 if (ifp->ifindex != IFINDEX_INTERNAL)
** CID 1458174: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 244 in if_lookup_by_name()
________________________________________________________________________________________________________
*** CID 1458174: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 244 in if_lookup_by_name()
238 : IFINDEX_INTERNAL;
239 }
240
241 /* Interface existance check by interface name. */
242 struct interface *if_lookup_by_name(const char *name, vrf_id_t vrf_id)
243 {
>>> CID 1458174: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "vrf" = null return value from "vrf_lookup_by_id".
244 struct vrf *vrf = vrf_lookup_by_id(vrf_id);
245 struct interface if_tmp;
246
247 if (!name || strnlen(name, INTERFACE_NAMSIZ) == INTERFACE_NAMSIZ)
248 return NULL;
249
** CID 1458173: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 197 in if_delete()
________________________________________________________________________________________________________
*** CID 1458173: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 197 in if_delete()
191 list_delete_all_node(ifp->nbr_connected);
192 }
193
194 /* Delete and free interface structure. */
195 void if_delete(struct interface *ifp)
196 {
>>> CID 1458173: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "vrf" = null return value from "vrf_lookup_by_id".
197 struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
198
199 IFNAME_RB_REMOVE(vrf, ifp);
200 if (ifp->ifindex != IFINDEX_INTERNAL)
201 IFINDEX_RB_REMOVE(vrf, ifp);
202
** CID 1458172: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 216 in if_lookup_by_index()
________________________________________________________________________________________________________
*** CID 1458172: Null pointer dereferences (NULL_RETURNS)
/lib/if.c: 216 in if_lookup_by_index()
210 XFREE(MTYPE_IF, ifp);
211 }
212
213 /* Interface existance check by index. */
214 struct interface *if_lookup_by_index(ifindex_t ifindex, vrf_id_t vrf_id)
215 {
>>> CID 1458172: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "vrf" = null return value from "vrf_lookup_by_id".
216 struct vrf *vrf = vrf_lookup_by_id(vrf_id);
217 struct interface if_tmp;
218
219 if_tmp.ifindex = ifindex;
220 return RB_FIND(if_index_head, &vrf->ifaces_by_index, &if_tmp);
221 }
** CID 1458171: (NULL_RETURNS)
/pimd/pim_iface.c: 906 in pim_find_primary_addr()
/pimd/pim_iface.c: 908 in pim_find_primary_addr()
________________________________________________________________________________________________________
*** CID 1458171: (NULL_RETURNS)
/pimd/pim_iface.c: 906 in pim_find_primary_addr()
900 * and use that as the primary address
901 */
902 if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
903 struct interface *lo_ifp;
904 // DBS - Come back and check here
905 if (ifp->vrf_id == VRF_DEFAULT)
>>> CID 1458171: (NULL_RETURNS)
>>> Dereferencing a null pointer "vrf".
906 lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
907 else
908 lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
909
910 if (lo_ifp)
911 return pim_find_primary_addr(lo_ifp);
/pimd/pim_iface.c: 908 in pim_find_primary_addr()
902 if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
903 struct interface *lo_ifp;
904 // DBS - Come back and check here
905 if (ifp->vrf_id == VRF_DEFAULT)
906 lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
907 else
>>> CID 1458171: (NULL_RETURNS)
>>> Dereferencing a null pointer "vrf".
908 lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
909
910 if (lo_ifp)
911 return pim_find_primary_addr(lo_ifp);
912 }
913
** CID 1458170: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_nht.c: 651 in pim_parse_nexthop_update()
________________________________________________________________________________________________________
*** CID 1458170: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_nht.c: 651 in pim_parse_nexthop_update()
645 struct pim_rpf rpf;
646 struct pim_nexthop_cache *pnc = NULL;
647 struct pim_neighbor *nbr = NULL;
648 struct interface *ifp = NULL;
649 struct interface *ifp1 = NULL;
650 struct vrf *vrf = vrf_lookup_by_id(vrf_id);
>>> CID 1458170: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a null pointer "vrf".
651 struct pim_instance *pim = vrf->info;
652
653 s = zclient->ibuf;
654 memset(&p, 0, sizeof(struct prefix));
655 p.family = stream_getw(s);
656 p.prefixlen = stream_getc(s);
** CID 1458169: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_iface.c: 800 in pim_if_addr_del_all()
________________________________________________________________________________________________________
*** CID 1458169: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_iface.c: 800 in pim_if_addr_del_all()
794 void pim_if_addr_del_all(struct interface *ifp)
795 {
796 struct connected *ifc;
797 struct listnode *node;
798 struct listnode *nextnode;
799 struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
>>> CID 1458169: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a null pointer "vrf".
800 struct pim_instance *pim = vrf->info;
801
802 /* PIM/IGMP enabled ? */
803 if (!ifp->info)
804 return;
805
** CID 1458168: Null pointer dereferences (NULL_RETURNS)
/ospfd/ospfd.c: 252 in ospf_new()
________________________________________________________________________________________________________
*** CID 1458168: Null pointer dereferences (NULL_RETURNS)
/ospfd/ospfd.c: 252 in ospf_new()
246 zlog_debug("%s: Create new ospf instance with vrf_name %s vrf_id %d",
247 __PRETTY_FUNCTION__, name, new->vrf_id);
248 if (vrf)
249 ospf_vrf_link(new, vrf);
250 } else {
251 new->vrf_id = VRF_DEFAULT;
>>> CID 1458168: Null pointer dereferences (NULL_RETURNS)
>>> Assigning: "vrf" = null return value from "vrf_lookup_by_id".
252 vrf = vrf_lookup_by_id(VRF_DEFAULT);
253 ospf_vrf_link(new, vrf);
254 }
255 ospf_zebra_vrf_register(new);
256
257 new->abr_type = OSPF_ABR_DEFAULT;
** CID 1458167: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_zebra.c: 351 in pim_zebra_if_address_del()
________________________________________________________________________________________________________
*** CID 1458167: Null pointer dereferences (NULL_RETURNS)
/pimd/pim_zebra.c: 351 in pim_zebra_if_address_del()
345 static int pim_zebra_if_address_del(int command, struct zclient *client,
346 zebra_size_t length, vrf_id_t vrf_id)
347 {
348 struct connected *c;
349 struct prefix *p;
350 struct vrf *vrf = vrf_lookup_by_id(vrf_id);
>>> CID 1458167: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a null pointer "vrf".
351 struct pim_instance *pim = vrf->info;
352
353 /*
354 zebra api notifies address adds/dels events by using the same call
355 interface_add_read below, see comments in lib/zclient.c
356
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRa7dJ8klHLUFWVd2fqpS-2B-2FHaN43B-2FQ11ntcKmbKat2WeHs8691VOJpZofPkpp-2BRBqc-3D_d-2Fi2nRutHp-2FDWtw8JRg-2Bc1m9CS4-2B5uVbodfDyLsp-2FJnZKUDo8hWIusOqLTHMWfQFj1RXeNTVIaqSRWe-2Bf6VIqAMDDcnso8jZ-2Bt0N3y2RdCqJZXEcpw6Jdc8Wbowrgf7S0VQubRGETAAj-2FHvGNCP-2BbNDh-2BXOq-2B7e-2BbgnQ7i9Am5I2SQqlp6oIZdQCJyzx-2FjReYdlyHdk7bzC6bdpCQNMxPg-3D-3D
To manage Coverity Scan email notifications for "frr at lists.nox.tf", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4lcTWm1Zma8LQDNpOYqrETKrqBiM18kcBcL8b08LzBPOYJYGySZ4Vv7d5QYcnSbGxl3QyORKgEmDxh-2BE2mj6dp1V4JSs2jbMZuLnEQJOW0Z0-3D_d-2Fi2nRutHp-2FDWtw8JRg-2Bc1m9CS4-2B5uVbodfDyLsp-2FJnZKUDo8hWIusOqLTHMWfQFNC5W-2Fw3-2FL6oBnB9BpQ9pvTaOKTnT6mcMeJBgLOc6iyl9lHFSBN4IHPL9nG25pb6U0546TBp7ck2DyBv3s-2BkrFNGF2XPYjtvbma3k79y-2BxyNsYqRoNbkbzoZckRf3UFOzuWKcnXPPBNKPmOhu2tMvcw-3D-3D
More information about the dev
mailing list