diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 08:06:50 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-20 08:06:50 +0000 |
commit | f467c0769e7ef6ce52a511ff86aeb3b86bd3658f (patch) | |
tree | d2268895fb8e13168cd951f66c435e072b0bc957 /net | |
parent | fa2d3dca03141bd815f2bbdab5733ba72d9fd28c (diff) | |
download | chromium_src-f467c0769e7ef6ce52a511ff86aeb3b86bd3658f.zip chromium_src-f467c0769e7ef6ce52a511ff86aeb3b86bd3658f.tar.gz chromium_src-f467c0769e7ef6ce52a511ff86aeb3b86bd3658f.tar.bz2 |
net: Add NULL check for SpdyHttpStream::request_info_
There are some code paths which calls SpdyHttpStream::GetUploadProgress() before the stream gets initialized.
Also fixing some CHECKs to make them securer.
BUG=161823
TEST=net_unittests
Review URL: https://chromiumcodereview.appspot.com/11316094
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/spdy/spdy_http_stream.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 504ac1a..ab1b32f 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -79,7 +79,7 @@ const HttpResponseInfo* SpdyHttpStream::GetResponseInfo() const { } UploadProgress SpdyHttpStream::GetUploadProgress() const { - if (!request_info_->upload_data_stream) + if (!request_info_ || !request_info_->upload_data_stream) return UploadProgress(); return UploadProgress(request_info_->upload_data_stream->position(), @@ -271,7 +271,7 @@ void SpdyHttpStream::Cancel() { } int SpdyHttpStream::SendData() { - CHECK(request_info_->upload_data_stream); + CHECK(request_info_ && request_info_->upload_data_stream); CHECK_EQ(0, request_body_buf_->BytesRemaining()); // Read the data from the request body stream. @@ -295,7 +295,7 @@ bool SpdyHttpStream::OnSendHeadersComplete(int status) { } int SpdyHttpStream::OnSendBody() { - CHECK(request_info_->upload_data_stream); + CHECK(request_info_ && request_info_->upload_data_stream); const bool eof = request_info_->upload_data_stream->IsEOF(); if (request_body_buf_->BytesRemaining() > 0) { return stream_->WriteStreamData( @@ -313,7 +313,7 @@ int SpdyHttpStream::OnSendBody() { int SpdyHttpStream::OnSendBodyComplete(int status, bool* eof) { // |status| is the number of bytes written to the SPDY stream. - CHECK(request_info_->upload_data_stream); + CHECK(request_info_ && request_info_->upload_data_stream); *eof = false; if (status > 0) { |