From eb9278ca537568a00d6c788491cff98df667e453 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Fri, 19 Jul 2013 19:32:57 +1000 Subject: [PATCH] Check for negative wait time in socket_full. --- util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.c b/util.c index 879e51c6..16016d05 100644 --- a/util.c +++ b/util.c @@ -1033,6 +1033,8 @@ static bool socket_full(struct pool *pool, int wait) struct timeval timeout; fd_set rd; + if (unlikely(wait < 0)) + wait = 0; FD_ZERO(&rd); FD_SET(sock, &rd); timeout.tv_usec = 0;