mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-06-10 16:47:14 +00:00
A malicious or malformed server response with an enormous Content-Length header (e.g. 20000000000) caused the client to call res.body.reserve(len) with the untrusted value, triggering OOM before read_content's payload_max_length_ check could take effect. Cap the pre-reservation at payload_max_length_, since reading more than that is never useful.
4 lines
45 B
Plaintext
4 lines
45 B
Plaintext
HTTP/1.1 777
|
|
Content-Length:20000000000
|
|
|