diff --git a/shell/common/asar/asar_util.cc b/shell/common/asar/asar_util.cc index 0d3ebb33eb2f..c5436cf07b77 100644 --- a/shell/common/asar/asar_util.cc +++ b/shell/common/asar/asar_util.cc @@ -127,11 +127,8 @@ bool ReadFileToString(const base::FilePath& path, std::string* contents) { return false; contents->resize(info.size); - if (static_cast(info.size) != - src.Read(info.offset, const_cast(contents->data()), - contents->size())) { + if (!src.ReadAndCheck(info.offset, base::as_writable_byte_span(*contents))) return false; - } if (info.integrity) ValidateIntegrityOrDie(base::as_byte_span(*contents), *info.integrity);