diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2018-09-08 20:18:30 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2018-09-08 20:34:35 +0200 |
| commit | e10cfdaf51fd5662309eda11ff37dfac1d94abdf (patch) | |
| tree | 585a9484b626634f3aa565d05e04b7dc8e4a07ca | |
| parent | 4f4060f6abbfa004e0eb63b7c447776cc74c8d66 (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.c | 2 |
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; |
