mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
io.c: fix reads from uninitialized memory
This commit is contained in:
parent
d82987d12e
commit
966ca6143b
@ -1204,7 +1204,7 @@ sk_setup(sock *s)
|
|||||||
if (s->iface)
|
if (s->iface)
|
||||||
{
|
{
|
||||||
#ifdef SO_BINDTODEVICE
|
#ifdef SO_BINDTODEVICE
|
||||||
struct ifreq ifr;
|
struct ifreq ifr = {};
|
||||||
strcpy(ifr.ifr_name, s->iface->name);
|
strcpy(ifr.ifr_name, s->iface->name);
|
||||||
if (setsockopt(s->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0)
|
if (setsockopt(s->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0)
|
||||||
ERR("SO_BINDTODEVICE");
|
ERR("SO_BINDTODEVICE");
|
||||||
@ -1564,7 +1564,8 @@ sk_sendmsg(sock *s)
|
|||||||
{
|
{
|
||||||
struct iovec iov = {s->tbuf, s->tpos - s->tbuf};
|
struct iovec iov = {s->tbuf, s->tpos - s->tbuf};
|
||||||
byte cmsg_buf[CMSG_TX_SPACE];
|
byte cmsg_buf[CMSG_TX_SPACE];
|
||||||
sockaddr dst;
|
bzero(cmsg_buf, sizeof(cmsg_buf));
|
||||||
|
sockaddr dst = {};
|
||||||
|
|
||||||
sockaddr_fill(&dst, fam_to_af[s->fam], s->daddr, s->iface, s->dport);
|
sockaddr_fill(&dst, fam_to_af[s->fam], s->daddr, s->iface, s->dport);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user