Issue 49740 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer
This commit is contained in:
parent
4f8407a3a7
commit
cba9ef8c0b
@ -70,6 +70,10 @@
|
|||||||
#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20
|
#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT
|
||||||
|
#define CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT 1024
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH
|
#ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH
|
||||||
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits<size_t>::max)())
|
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits<size_t>::max)())
|
||||||
#endif
|
#endif
|
||||||
@ -5255,6 +5259,7 @@ Server::write_content_with_provider(Stream &strm, const Request &req,
|
|||||||
|
|
||||||
inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
||||||
MultipartFormDataMap::iterator cur;
|
MultipartFormDataMap::iterator cur;
|
||||||
|
auto file_count = 0;
|
||||||
if (read_content_core(
|
if (read_content_core(
|
||||||
strm, req, res,
|
strm, req, res,
|
||||||
// Regular
|
// Regular
|
||||||
@ -5265,6 +5270,9 @@ inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
|||||||
},
|
},
|
||||||
// Multipart
|
// Multipart
|
||||||
[&](const MultipartFormData &file) {
|
[&](const MultipartFormData &file) {
|
||||||
|
if (file_count++ == CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
cur = req.files.emplace(file.name, file);
|
cur = req.files.emplace(file.name, file);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user