forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a SimpleUrlLoader stream resume-after-timeout crash
Add a null check in DownloadAsStreamBodyHandler::Resume to protect against a rare case where Resume is called right after hitting the timeout. To demonstrate the crash, add a unit test that explicitly keeps hold of the resume closure until after a timeout is hit. Without the added fix, the test crashes accessing body_reader_. While it looks odd in the test, this case seems possible in valid-looking SimpleURLLoaderStreamConsumer code that happens to get tasks queued in an unlucky way right when the timeout is hit. Credit to mruszczynski@vewd.com for investigation and initial UT. Bug: 1169018 Change-Id: Iff38fb1e3a4404ae006e1f6b76479cdf6ffafa85 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2641033 Commit-Queue: Tomasz Śniatowski <tsniatowski@vewd.com> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Auto-Submit: Tomasz Śniatowski <tsniatowski@vewd.com> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#846019}
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters