[iccpd] Fix uninitialized variable. (#5112)

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};
This commit is contained in:
Kelly Chen 2020-08-21 15:27:04 +08:00 committed by GitHub
parent a273e56bc6
commit 570dbf52f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
{
@ -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)
{