Commit 05f18777 authored by jam's avatar jam Committed by Commit bot

Fix crash in network_service.

The problem is that |response| was passed in the Bind call before the body was taken out. I saw this because of null dereference on Windows. The order of evaluation is undefined, which is why it worked on Linux.

Review URL: https://codereview.chromium.org/1138443004

Cr-Commit-Position: refs/heads/master@{#330634}
parent 7dd05290
...@@ -141,8 +141,9 @@ void HttpConnectionImpl::OnReceivedHttpRequest( ...@@ -141,8 +141,9 @@ void HttpConnectionImpl::OnReceivedHttpRequest(
if (response->body.is_valid()) { if (response->body.is_valid()) {
SimpleDataPipeReader* reader = new SimpleDataPipeReader; SimpleDataPipeReader* reader = new SimpleDataPipeReader;
response_body_readers_.insert(reader); response_body_readers_.insert(reader);
ScopedDataPipeConsumerHandle body = response->body.Pass();
reader->Start( reader->Start(
response->body.Pass(), body.Pass(),
base::Bind(&HttpConnectionImpl::OnFinishedReadingResponseBody, base::Bind(&HttpConnectionImpl::OnFinishedReadingResponseBody,
base::Unretained(this), base::Passed(&response))); base::Unretained(this), base::Passed(&response)));
} else { } else {
......
Markdown is supported
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