Fix #700 null pointer exception (#702)

This commit is contained in:
Muchamad Arifin Dwi P 2020-10-17 07:44:14 +07:00 committed by GitHub
parent 5292142046
commit a4a9637738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2949,7 +2949,7 @@ public:
bool is_valid() const { return is_valid_; }
template <typename T, typename U>
bool parse(const char *buf, size_t n, T content_callback, U header_callback) {
bool parse(const char *buf, size_t n, const T &content_callback, const U &header_callback) {
static const std::regex re_content_disposition(
"^Content-Disposition:\\s*form-data;\\s*name=\"(.*?)\"(?:;\\s*filename="
@ -4273,8 +4273,8 @@ inline bool Server::read_content_core(Stream &strm, Request &req, Response &res,
}
return true;
*/
return multipart_form_data_parser.parse(buf, n, std::move(multipart_receiver),
std::move(mulitpart_header));
return multipart_form_data_parser.parse(buf, n, multipart_receiver,
mulitpart_header);
};
} else {
out = std::move(receiver);