bfdd: fix garbage "port" string

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>
This commit is contained in:
David Lamparter 2018-09-08 20:18:30 +02:00
parent 4f4060f6ab
commit e10cfdaf51

View 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;