Skip to content

Commit

Permalink
Specify string size to prevent heap-buffer-overflow. (#4091)
Browse files Browse the repository at this point in the history
b/363029201
  • Loading branch information
aee-google authored Sep 5, 2024
1 parent dbf1a55 commit 00284dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion starboard/loader_app/slot_management.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ bool ReadEvergreenVersion(std::vector<char>* manifest_file_path,

Json::Reader reader;
Json::Value obj;
if (!reader.parse(std::string(file_data.data()), obj) || !obj[kVersionKey]) {
if (!reader.parse(std::string(file_data.data(), file_size), obj) ||
!obj[kVersionKey]) {
SB_LOG(WARNING) << "Failed to parse version from the manifest file at the "
"installation path.";
return false;
Expand Down

0 comments on commit 00284dd

Please sign in to comment.