New Defects reported by Coverity Scan for freerangerouting/frr
scan-admin at coverity.com
scan-admin at coverity.com
Thu Jun 23 11:55:42 UTC 2022
Hi,
Please find the latest report on new defect(s) introduced to freerangerouting/frr found with Coverity Scan.
4 new defect(s) introduced to freerangerouting/frr found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)
** CID 1518664: (UNINIT)
________________________________________________________________________________________________________
*** CID 1518664: (UNINIT)
/ospfd/ospf_vty.c: 4410 in show_ip_ospf_neighbour_brief()
4404 time_val);
4405 json_object_int_add(json_neighbor, "deadTimeMsecs",
4406 time_store);
4407 json_object_int_add(json_neighbor,
4408 "routerDeadIntervalTimerDueMsec",
4409 time_store);
>>> CID 1518664: (UNINIT)
>>> Using uninitialized value "res.tv_usec" when calling "ospf_timeval_dump".
4410 json_object_string_add(
4411 json_neighbor, "upTime",
4412 ospf_timeval_dump(&res, uptime,
4413 sizeof(uptime)));
4414 json_object_string_add(
4415 json_neighbor, "deadTime",
/ospfd/ospf_vty.c: 4458 in show_ip_ospf_neighbour_brief()
4452 vty_out(vty, "%-15s %3d %-15s ", "-", nbr->priority,
4453 msgbuf);
4454 else
4455 vty_out(vty, "%-15pI4 %3d %-15s ", &nbr->router_id,
4456 nbr->priority, msgbuf);
4457
>>> CID 1518664: (UNINIT)
>>> Using uninitialized value "res.tv_usec" when calling "ospf_timeval_dump".
4458 vty_out(vty, "%-15s ",
4459 ospf_timeval_dump(&res, uptime, sizeof(uptime)));
4460
4461 vty_out(vty, "%9s ",
4462 ospf_timer_dump(nbr->t_inactivity, timebuf,
4463 sizeof(timebuf)));
** CID 1518663: (CONSTANT_EXPRESSION_RESULT)
/zebra/zapi_msg.c: 1650 in nexthop_from_zapi()
/zebra/zapi_msg.c: 1616 in nexthop_from_zapi()
________________________________________________________________________________________________________
*** CID 1518663: (CONSTANT_EXPRESSION_RESULT)
/zebra/zapi_msg.c: 1650 in nexthop_from_zapi()
1644 memset(&vtep_ip, 0, sizeof(vtep_ip));
1645 vtep_ip.ipa_type = IPADDR_V6;
1646 memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6),
1647 sizeof(struct in6_addr));
1648 zebra_rib_queue_evpn_route_add(
1649 api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
>>> CID 1518663: (CONSTANT_EXPRESSION_RESULT)
>>> In "nexthop->flags |= 256 /* 1 << 8 */", wider "256 /* 1 << 8 */" has high-order bits (0x100) that don't affect the narrower left-hand side.
1650 SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN);
1651 }
1652 break;
1653 case NEXTHOP_TYPE_BLACKHOLE:
1654 if (IS_ZEBRA_DEBUG_RECV)
1655 zlog_debug("%s: nh blackhole %d",
/zebra/zapi_msg.c: 1616 in nexthop_from_zapi()
1610 memset(&vtep_ip, 0, sizeof(vtep_ip));
1611 vtep_ip.ipa_type = IPADDR_V4;
1612 memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4),
1613 sizeof(struct in_addr));
1614 zebra_rib_queue_evpn_route_add(
1615 api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
>>> CID 1518663: (CONSTANT_EXPRESSION_RESULT)
>>> In "nexthop->flags |= 256 /* 1 << 8 */", wider "256 /* 1 << 8 */" has high-order bits (0x100) that don't affect the narrower left-hand side.
1616 SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN);
1617 }
1618 break;
1619 case NEXTHOP_TYPE_IPV6:
1620 if (IS_ZEBRA_DEBUG_RECV) {
1621 inet_ntop(AF_INET6, &api_nh->gate.ipv6, nhbuf,
** CID 1518662: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/zebra/zebra_fpm_netlink.c: 211 in netlink_route_info_add_nh()
________________________________________________________________________________________________________
*** CID 1518662: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/zebra/zebra_fpm_netlink.c: 211 in netlink_route_info_add_nh()
205 src = &nexthop->src;
206 }
207
208 if (!nhi.gateway && nhi.if_index == 0)
209 return 0;
210
>>> CID 1518662: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
>>> "nexthop->flags & (256 /* 1 << 8 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
211 if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN)) {
212 nhi.encap_info.encap_type = FPM_NH_ENCAP_VXLAN;
213
214 /* Extract VNI id for the nexthop SVI interface */
215 zvrf = zebra_vrf_lookup_by_id(nexthop->vrf_id);
216 if (zvrf) {
** CID 1518661: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/lib/zclient.c: 1833 in zapi_nexthop_from_nexthop()
________________________________________________________________________________________________________
*** CID 1518661: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/lib/zclient.c: 1833 in zapi_nexthop_from_nexthop()
1827 znh->ifindex = nh->ifindex;
1828 znh->gate = nh->gate;
1829
1830 if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ONLINK))
1831 SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_ONLINK);
1832
>>> CID 1518661: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
>>> "nh->flags & (256 /* 1 << 8 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
1833 if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_EVPN))
1834 SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_EVPN);
1835
1836 if (nh->nh_label && (nh->nh_label->num_labels > 0)) {
1837
1838 /* Validate */
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yrtN2DGUU98GYhjd55wXsXtw53zRK70R0agdV-2Fb7c45-2BkxBoZjryQtr5SpUD80NNfE-3D3gNe_O0IDF7c8sUs2B6kWTeWwAJZqriD5fgsfL8PAN30oQTwEEwP8AyYqCBzAaaBLh900i8gq9cPnlPIrLTMZDq-2B7Kf1ZOco1QOGxvk47-2Fva5dfHzIke7PEIuZvBH34PnQdSWqxsP-2BTopXvHQsD9bke-2FD3fjXzgIux7YjG41LPnG72Ac-2FnBtijhgZmkGkOmlFH9BM6b616vfnFK8tDKVQDGkiaw-3D-3D
More information about the dev
mailing list