aboutsummaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
authorJuha Riihimäki <juha.riihimaki@nokia.com>2010-04-13 09:16:55 +0300
committerBlue Swirl <blauwirbel@gmail.com>2010-04-20 16:42:38 +0000
commitab07b980c442b4f94f8fe9c236d7702c19bf2c74 (patch)
tree5c486b61f78a58a16c699925c2d2833bc8747993 /slirp
parentd3538b45ea88e82d1b01959b4ca55d3696b71cb2 (diff)
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 'slirp')
-rw-r--r--slirp/socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/slirp/socket.c b/slirp/socket.c
index 8a257acc83..eaad77af8d 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -587,6 +587,7 @@ tcp_listen(Slirp *slirp, u_int32_t haddr, u_int hport, u_int32_t laddr,
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);