Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 1956403005: [Merge M51][Downloads] BaseFile shouldn't read past the expected EOF for a stub file. (Closed)

Created:
4 years, 7 months ago by asanka
Modified:
4 years, 7 months ago
Reviewers:
svaldez
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2704
Target Ref:
refs/pending/branch-heads/2704
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -11 lines) Patch
M content/browser/download/base_file.cc View 1 chunk +9 lines, -3 lines 0 comments Download
M content/browser/download/base_file_unittest.cc View 9 chunks +46 lines, -8 lines 0 comments Download
M content/browser/download/download_browsertest.cc View 1 chunk +68 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
asanka
4 years, 7 months ago (2016-05-10 04:18:13 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
2bb4bee49cf1ef7c9c19b4790f5caf80a77c3ccf.

Powered by Google App Engine
This is Rietveld 408576698