Commit 966ca614 authored by Pavel Tvrdík's avatar Pavel Tvrdík

io.c: fix reads from uninitialized memory

parent d82987d1
......@@ -1204,7 +1204,7 @@ sk_setup(sock *s)
if (s->iface)
struct ifreq ifr;
struct ifreq ifr = {};
strcpy(ifr.ifr_name, s->iface->name);
if (setsockopt(s->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0)
......@@ -1564,7 +1564,8 @@ sk_sendmsg(sock *s)
struct iovec iov = {s->tbuf, s->tpos - s->tbuf};
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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment