]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix statistics channel multiple request processing with non-empty bodies
authorAram Sargsyan <aram@isc.org>
Wed, 20 Jul 2022 10:18:56 +0000 (10:18 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 19 Aug 2022 08:27:01 +0000 (08:27 +0000)
commitd4c5d1c650ae0e97a083b0ce7a705c20fc001f07
tree0c23b448f6a38f1ae6da0f90fbbee6b17a0ac948
parent1005dd74d9ea0c39a24c71e90aef7ad16b3d3107
Fix statistics channel multiple request processing with non-empty bodies

When the HTTP request has a body part after the HTTP headers, it is
not getting processed and is being prepended to the next request's data,
which results in an error when trying to parse it.

Improve the httpd.c:process_request() function with the following
additions:

1. Require that HTTP POST requests must have Content-Length header.
2. When Content-Length header is set, extract its value, and make sure
   that it is valid and that the whole request's body is received before
   processing the request.
3. Discard the request's body by consuming Content-Length worth of data
   in the buffer.

(cherry picked from commit c2bbdc8a648c9630b2c9cea5227ad5c309c2ade5)
lib/isc/httpd.c