From f9b391645fbb8c641604440646e25b7a7eab97d2 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 13 Jan 2017 15:00:32 -0500 Subject: [PATCH] [mod_cgi] check cgi fd for num bytes ready to read (fix code which incorrectly checked con->fd, which may have resulted in suboptimal buffer size for read) --- src/mod_cgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod_cgi.c b/src/mod_cgi.c index 30536273..32d2a47f 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -398,7 +398,7 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) { #if defined(__WIN32) buffer_string_prepare_copy(hctx->response, 4 * 1024); #else - if (ioctl(con->fd, FIONREAD, &toread) || toread <= 4*1024) { + if (ioctl(hctx->fd, FIONREAD, &toread) || toread <= 4*1024) { buffer_string_prepare_copy(hctx->response, 4 * 1024); } else { if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT; -- 2.11.4.GIT