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

(cherry picked from commit 00284dd)
  • Loading branch information
aee-google authored and anonymous1-me committed Sep 6, 2024
1 parent 4d181b3 commit 7485329
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 7485329

Please sign in to comment.