]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: rtadv uses uninited data to sendmsg
authorDonald Sharp <sharpd@nvidia.com>
Tue, 19 Mar 2024 22:29:31 +0000 (18:29 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 10 Apr 2024 13:24:13 +0000 (09:24 -0400)
valgrind is complaining about this problem.
This fixes it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/rtadv.c

index 6aca643bd8e23f1d5328b6ce0c5a6e4239499313..470391de9be2924181b9c7cf54c81535adb8604a 100644 (file)
@@ -184,13 +184,13 @@ static int rtadv_recv_packet(struct zebra_vrf *zvrf, int sock, uint8_t *buf,
 static void rtadv_send_packet(int sock, struct interface *ifp,
                              enum ipv6_nd_suppress_ra_status stop)
 {
-       struct msghdr msg;
-       struct iovec iov;
+       struct msghdr msg = { 0 };
+       struct iovec iov = { 0 };
        struct cmsghdr *cmsgptr;
        struct in6_pktinfo *pkt;
-       struct sockaddr_in6 addr;
-       unsigned char buf[RTADV_MSG_SIZE];
-       char adata[RTADV_ADATA_SIZE];
+       struct sockaddr_in6 addr = { 0 };
+       unsigned char buf[RTADV_MSG_SIZE] = { 0 };
+       char adata[RTADV_ADATA_SIZE] = { 0 };
 
        struct nd_router_advert *rtadv;
        int ret;