Skip to content

Commit

Permalink
fix: out-of-bounds read of MIME types (#1104)
Browse files Browse the repository at this point in the history
  • Loading branch information
VoltrexKeyva authored Mar 4, 2024
1 parent 63c00d8 commit 3f34d9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dpp/httpsclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ multipart_content https_client::build_multipart(const std::string &json, const s
/* Multiple files */
for (size_t i = 0; i < filenames.size(); ++i) {
content += part_start + "name=\"files[" + std::to_string(i) + "]\"; filename=\"" + filenames[i] + "\"";
content += "\r\nContent-Type: " + (mimetypes.size() < i || mimetypes[i].empty() ? default_mime_type : mimetypes[i]) + two_cr;
content += "\r\nContent-Type: " + (mimetypes.size() <= i || mimetypes[i].empty() ? default_mime_type : mimetypes[i]) + two_cr;
content += contents[i];
content += "\r\n";
}
Expand Down

0 comments on commit 3f34d9d

Please sign in to comment.