summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-09-08 20:18:30 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2018-09-08 20:34:35 +0200
commite10cfdaf51fd5662309eda11ff37dfac1d94abdf (patch)
tree585a9484b626634f3aa565d05e04b7dc8e4a07ca
parent4f4060f6abbfa004e0eb63b7c447776cc74c8d66 (diff)
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>
-rw-r--r--bfdd/bfd_packet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c
index 4bdfb314e2..8acb9438c5 100644
--- a/bfdd/bfd_packet.c
+++ b/bfdd/bfd_packet.c
@@ -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;