mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Fix "Issue 39922 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer"
This commit is contained in:
parent
c7554ccac2
commit
d17ac3bb40
4 changed files with 35 additions and 45 deletions
|
@ -4967,6 +4967,10 @@ inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
|||
})) {
|
||||
const auto &content_type = req.get_header_value("Content-Type");
|
||||
if (!content_type.find("application/x-www-form-urlencoded")) {
|
||||
if (req.body.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
||||
res.status = 413; // NOTE: should be 414?
|
||||
return false;
|
||||
}
|
||||
detail::parse_query_text(req.body, req.params);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue