]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: server: Properly handle corrupt payload while finishing a request.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 20 Mar 2018 17:14:39 +0000 (18:14 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 30 Jul 2018 06:51:41 +0000 (09:51 +0300)
The HTTP_REQUEST_PARSE_ERROR_BROKEN_REQUEST was not handled, causing an
assertion panic. This situation occurred when the chunked transfer encoding was
invalid.

src/lib-http/http-server-connection.c

index 989114152c7ae333a30340ec51f4dc39e264b464..4cbffc9dfe7588123f48b55ec6b52b913d1f294e 100644 (file)
@@ -521,6 +521,11 @@ http_server_connection_finish_request(struct http_server_connection *conn)
                                http_server_request_fail_close(req,
                                        413, "Payload Too Large");
                                break;
+                       case HTTP_REQUEST_PARSE_ERROR_BROKEN_REQUEST:
+                               conn->input_broken = TRUE;
+                               http_server_request_fail_close(req,
+                                       400, "Bad request");
+                               break;
                        default:
                                i_unreached();
                        }