From ee9c3d1860bc81ebd43862d502ef2f9f71e6c299 Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 24 Nov 2020 13:10:15 +0000 Subject: get_request_sock: set nr_fds always (#116) --- lib/tran_sock.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/tran_sock.c') diff --git a/lib/tran_sock.c b/lib/tran_sock.c index 7834a77..3ad1222 100644 --- a/lib/tran_sock.c +++ b/lib/tran_sock.c @@ -661,6 +661,8 @@ get_request_sock(lm_ctx_t *lm_ctx, struct vfio_user_header *hdr, msg.msg_controllen = CMSG_SPACE(sizeof(int) * *nr_fds); msg.msg_control = alloca(msg.msg_controllen); + *nr_fds = 0; + /* * TODO ideally we should set O_NONBLOCK on the fd so that the syscall is * faster (?). I tried that and get short reads, so we need to store the -- cgit v1.1