Chromium Code Reviews
Description[Merge M51][Downloads] BaseFile shouldn't read past the expected EOF for a stub file.
The partial stub file may have more data than expected due to
discrepancy between persisted metadata and the intermediate file.
Currently we resolve this conflict in favor of persisted metadata and
truncate the partial file to match. In this case, BaseFile::Initialize()
-> BaseFile::CalculatePartialHash() ended up reading past teh expected
EOF for large intermediate files. Consequently, BaseFile would conclude
incorrectly that the partial file is too short.
This patch fixes this bug by correctly stopping reading prior to the
expected EOF.
R=svaldez@chromium.org
BUG=603330
Review URL: https://codereview.chromium.org/1887873002
Cr-Commit-Position: refs/heads/master@{#387370}
(cherry picked from commit aeeba88e199ca02307bf5dfb651c867cfdb94a16)
Committed: https://chromium.googlesource.com/chromium/src/+/2bb4bee49cf1ef7c9c19b4790f5caf80a77c3ccf
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||