Skip to content
Snippets Groups Projects
Unverified Commit 40d55328 authored by trop[bot]'s avatar trop[bot] Committed by GitHub
Browse files

fix: -Wunsafe-buffer-usage warning in asar_util's ReadFileToString()


Co-authored-by: default avatarCharles Kerr <charles@charleskerr.com>
parent 34bed11a
No related merge requests found
...@@ -127,11 +127,8 @@ bool ReadFileToString(const base::FilePath& path, std::string* contents) { ...@@ -127,11 +127,8 @@ bool ReadFileToString(const base::FilePath& path, std::string* contents) {
return false; return false;
contents->resize(info.size); contents->resize(info.size);
if (static_cast<int>(info.size) != if (!src.ReadAndCheck(info.offset, base::as_writable_byte_span(*contents)))
src.Read(info.offset, const_cast<char*>(contents->data()),
contents->size())) {
return false; return false;
}
if (info.integrity) if (info.integrity)
ValidateIntegrityOrDie(base::as_byte_span(*contents), *info.integrity); ValidateIntegrityOrDie(base::as_byte_span(*contents), *info.integrity);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment