Skip to content

Commit

Permalink
Cherry pick PR #4091: Specify string size to prevent heap-buffer-over…
Browse files Browse the repository at this point in the history
…flow. (#4094)

Refer to the original PR: #4091

b/363029201

Co-authored-by: aee <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and aee-google committed Sep 6, 2024
1 parent 4d181b3 commit 727a2b7
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 727a2b7

Please sign in to comment.