diff options
author | Juha Riihimäki <juha.riihimaki@nokia.com> | 2010-04-13 09:16:55 +0300 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-04-20 16:42:38 +0000 |
commit | ae1e6b3a8ef4e11e8c34e73721b6d9dfb891e103 (patch) | |
tree | 4816af899c0bccb37620c67bf2ad7911d9225a2d /socket.c | |
parent | 3213c9e1e754ca38e47c3d618cc69b666f10fef9 (diff) | |
download | slirp-ae1e6b3a8ef4e11e8c34e73721b6d9dfb891e103.zip slirp-ae1e6b3a8ef4e11e8c34e73721b6d9dfb891e103.tar.gz slirp-ae1e6b3a8ef4e11e8c34e73721b6d9dfb891e103.tar.bz2 |
slirp: fix structure initialization in tcp_listen()
A data structure of type sockaddr_in is allocated from stack but not
properly initialized. This may lead to a failure in the bind() call
later on. Fixed by filling the contents of the structure with zeroes
before using it.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -593,6 +593,7 @@ struct socket *tcp_listen(Slirp *slirp, u_int32_t haddr, u_int hport, struct socket *so; int s, opt = 1; socklen_t addrlen = sizeof(addr); + memset(&addr, 0, addrlen); DEBUG_CALL("tcp_listen"); DEBUG_ARG("haddr = %x", haddr); |