diff --git a/src/network/slirp/socket.c b/src/network/slirp/socket.c index 81a499f18..36d005192 100644 --- a/src/network/slirp/socket.c +++ b/src/network/slirp/socket.c @@ -167,10 +167,10 @@ size_t sopreprbuf(struct socket *so, struct iovec *iov, int *np) */ int soread(struct socket *so) { - int n, nn; + int n = 0, nn; size_t buf_len; struct sbuf *sb = &so->so_snd; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("soread"); DEBUG_ARG("so = %p", so); @@ -248,7 +248,7 @@ int soreadbuf(struct socket *so, const char *buf, int size) { int n, nn, copy = size; struct sbuf *sb = &so->so_snd; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("soreadbuf"); DEBUG_ARG("so = %p", so); @@ -396,7 +396,7 @@ int sowrite(struct socket *so) int n, nn; struct sbuf *sb = &so->so_rcv; int len = sb->sb_cc; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("sowrite"); DEBUG_ARG("so = %p", so);