Skip to content

Commit

Permalink
bgpd: fix coverity issue in bgpd
Browse files Browse the repository at this point in the history
Should address this issue:
** CID 1566843:  Uninitialized variables  (UNINIT)
/bgpd/bgp_route.c: 6754 in bgp_static_set()
6748                            bgp_static->backdoor = backdoor;
6749                            bgp_static->valid = 0;
6750                            bgp_static->igpmetric = 0;
6751                            bgp_static->igpnexthop.s_addr = INADDR_ANY;
6752                            bgp_static->label_index = label_index;
6753                            bgp_static->label = label;
>>>     CID 1566843:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value prd.
6754                            bgp_static->prd = prd;
6755
6756                            if (rmap) {
6757                                    XFREE(MTYPE_ROUTE_MAP_NAME,
6758                                          bgp_static->rmap.name);
6759                                    route_map_counter_decrement(

Testing Done:
 build

Ticket: #NA
Signed-off-by: Rajesh Varatharaj <[email protected]>
  • Loading branch information
routingrocks committed Aug 15, 2023
1 parent 2b4e038 commit d33bd63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -6610,6 +6610,7 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str,
}

if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN) {
memset(&prd, 0, sizeof(prd));
ret = str2prefix_rd(rd_str, &prd);
if (!ret) {
vty_out(vty, "%% Malformed rd\n");
Expand Down

0 comments on commit d33bd63

Please sign in to comment.