From 3a862e3b1047a081061d5ea207a7db3ec47a2e6d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 2 Jun 2015 08:02:14 -0700 Subject: Fix MSAN reported error --- src/core/iomgr/pollset_posix.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 0a18d18671..1055006740 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -389,11 +389,13 @@ static int basic_pollset_maybe_work(grpc_pollset *pollset, if (pfd[0].revents & POLLIN) { grpc_pollset_kick_consume(&pollset->kick_state, kfd); } - if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) { - grpc_fd_become_readable(fd, allow_synchronous_callback); - } - if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) { - grpc_fd_become_writable(fd, allow_synchronous_callback); + if (nfds > 1) { + if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) { + grpc_fd_become_readable(fd, allow_synchronous_callback); + } + if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) { + grpc_fd_become_writable(fd, allow_synchronous_callback); + } } } -- cgit v1.2.3