diff options
author | Pavel Tvrdik <pawel.tvrdik@gmail.com> | 2016-05-03 09:32:49 +0200 |
---|---|---|
committer | Pavel Tvrdik <pawel.tvrdik@gmail.com> | 2016-05-03 11:02:48 +0200 |
commit | f7a99acb4eac23223f51ce83b8081cc9695fef1e (patch) | |
tree | 73aec360467c67a250c896b13995be47decf411d /sysdep/unix | |
parent | 1e3810f9f8e251d82a8157b39df9be196315c43e (diff) |
Initialize variable ifr in sk_setup()
==00:00:00:02.831 2468== Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s)
==00:00:00:02.831 2468== at 0x513BDEA: setsockopt (in /usr/lib/libc-2.23.so)
==00:00:00:02.831 2468== by 0x45C7AF: sk_setup (io.c:1216)
==00:00:00:02.831 2468== by 0x45CDFF: sk_open (io.c:1417)
==00:00:00:02.831 2468== by 0x44B562: rip_open_socket (packets.c:740)
==00:00:00:02.831 2468== by 0x4481A7: rip_iface_locked (rip.c:616)
==00:00:00:02.831 2468== by 0x4133E4: olock_run_event (locks.c:177)
==00:00:00:02.831 2468== by 0x45A6DE: ev_run (event.c:85)
==00:00:00:02.831 2468== by 0x45A7AD: ev_run_list (event.c:142)
==00:00:00:02.831 2468== by 0x45E0FC: io_loop (io.c:2066)
==00:00:00:02.831 2468== by 0x463B56: main (main.c:845)
==00:00:00:02.831 2468== Address 0xffefffd24 is on thread 1's stack
==00:00:00:02.831 2468== in frame #1, created by sk_setup (io.c:1188)
==00:00:00:02.831 2468== Uninitialised value was created by a stack allocation
==00:00:00:02.831 2468== at 0x45C6BB: sk_setup (io.c:1188)
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index d918d321..82f6c69e 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1211,7 +1211,7 @@ sk_setup(sock *s) if (s->iface) { #ifdef SO_BINDTODEVICE - 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) ERR("SO_BINDTODEVICE"); |