]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: fix garbage "port" string 2994/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 8 Sep 2018 18:18:30 +0000 (20:18 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 8 Sep 2018 18:34:35 +0000 (20:34 +0200)
bfd_recv_ipv4() is getting an uninitialized buffer passed in as port,
and then checks it without clearing it first.  Thus we can end up
leaving garbage data in it.

Signed-off-by: David Lamparter <equinox@diac24.net>
bfdd/bfd_packet.c

index 4bdfb314e2348a9e13e3c181a95304d5d6d4b1b3..8acb9438c564662af5ccc903ce3becb3229ebe5b 100644 (file)
@@ -248,6 +248,8 @@ ssize_t bfd_recv_ipv4(int sd, uint8_t *msgbuf, size_t msgbuflen, uint8_t *ttl,
        struct iovec iov[1];
        uint8_t cmsgbuf[255];
 
+       port[0] = '\0';
+
        /* Prepare the recvmsg params. */
        iov[0].iov_base = msgbuf;
        iov[0].iov_len = msgbuflen;