mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Issue 49740 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer
This commit is contained in:
parent
4f8407a3a7
commit
cba9ef8c0b
1 changed files with 8 additions and 0 deletions
|
@ -70,6 +70,10 @@
|
|||
#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT
|
||||
#define CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT 1024
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH
|
||||
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits<size_t>::max)())
|
||||
#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) {
|
||||
MultipartFormDataMap::iterator cur;
|
||||
auto file_count = 0;
|
||||
if (read_content_core(
|
||||
strm, req, res,
|
||||
// Regular
|
||||
|
@ -5265,6 +5270,9 @@ inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
|||
},
|
||||
// Multipart
|
||||
[&](const MultipartFormData &file) {
|
||||
if (file_count++ == CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT) {
|
||||
return false;
|
||||
}
|
||||
cur = req.files.emplace(file.name, file);
|
||||
return true;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue