Skip to content

Commit

Permalink
[iccpd] Fix uninitialized variable. (#5112)
Browse files Browse the repository at this point in the history
To declare *tb[] but do not initialize it, it might be very risky. We get iccpd exception during processing arp/nd event. Initialize it to {0};
  • Loading branch information
chenkelly authored Aug 21, 2020
1 parent a273e56 commit 570dbf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iccpd/src/iccp_ifm.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ int do_one_neigh_request(struct nlmsghdr *n)
{
struct ndmsg *ndm = NLMSG_DATA(n);
int len = n->nlmsg_len;
struct rtattr * tb[NDA_MAX + 1];
struct rtattr *tb[NDA_MAX + 1] = {0};

if (n->nlmsg_type == NLMSG_DONE)
{
Expand Down Expand Up @@ -966,7 +966,7 @@ void iccp_parse_if_vlan_info_from_netlink(struct nlmsghdr *n)
{
struct ifinfomsg *ifm = NLMSG_DATA(n);
int len = n->nlmsg_len;
struct rtattr * tb[IFLA_MAX + 1];
struct rtattr *tb[IFLA_MAX + 1] = {0};

if (n->nlmsg_type != RTM_NEWLINK)
{
Expand Down

0 comments on commit 570dbf5

Please sign in to comment.