libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit d71165ed3aa33e4c321a8b70239f9169dbba86f2
parent 07e0a5ea0ad889f4f4a9f19755073383963f9868
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 28 May 2014 13:48:57 +0000

second attempt to properly commit patch for #3392

Diffstat:
MChangeLog | 5+++++
Msrc/microhttpd/connection.c | 8++++++--
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 28 15:30:56 CEST 2014 + Properly applying patch that was supposed to be + committed on "May 2 20:22:45 CEST 2014" to address + infinite loop (DoS) when HTTP connection is reset (#3392). -GM + Sun May 25 20:18:27 CEST 2014 Fixed W32 build issues. -EG Releasing 0.9.36. -CG diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -1620,9 +1620,13 @@ do_read (struct MHD_Connection *connection) if (bytes_read < 0) { const int err = MHD_socket_errno_; - if ((EINTR == err) || (EAGAIN == err) || (ECONNRESET == err) - || (EWOULDBLOCK == err)) + if ((EINTR == err) || (EAGAIN == err) || (EWOULDBLOCK == err)) return MHD_NO; + if (ECONNRESET == err) + { + CONNECTION_CLOSE_ERROR(connection, NULL); + return MHD_NO; + } #if HAVE_MESSAGES #if HTTPS_SUPPORT if (0 != (connection->daemon->options & MHD_USE_SSL))