diff --git a/util-net.c b/util-net.c index 090a8d7e7..f88e27d50 100644 --- a/util-net.c +++ b/util-net.c @@ -102,6 +102,8 @@ int recv_fds(int sock, int *fds, int nr_fds, char *flags) cmsg = CMSG_FIRSTHDR(&fdset.hdr); if (!cmsg || cmsg->cmsg_type != SCM_RIGHTS) return -EINVAL; + if (fdset.hdr.msg_flags & MSG_CTRUNC) + return -ENFILE; min_fd = (cmsg->cmsg_len - sizeof(struct cmsghdr)) / sizeof(int); /*