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

Unified Diff: net/http/http_cache_transaction.cc

Issue 7222027: Add checks for entry_. From coverity CID=8237 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add null and return checks Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/base/decompressor_zlib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 9af0c83720d88292039da51d2f74ca25159907d0..d2faa21691d97f1198b1c53315e9646abea97cd7 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1030,7 +1030,7 @@ int HttpCache::Transaction::DoUpdateCachedResponseComplete(int result) {
DoneWritingToEntry(true);
} else if (entry_ && !server_responded_206_) {
DCHECK_EQ(READ_WRITE, mode_);
- if (!partial_.get() || partial_->IsLastRange()) {
+ if (entry_ && !partial_.get() || partial_->IsLastRange()) {
rvargas (doing something else) 2011/06/23 19:00:27 entry_ is already considered at line 1031
Greg Billock 2011/06/23 20:13:25 Done.
cache_->ConvertWriterToReader(entry_);
mode_ = READ;
}
@@ -1513,8 +1513,10 @@ int HttpCache::Transaction::BeginCacheValidation() {
next_state_ = STATE_PARTIAL_HEADERS_RECEIVED;
return OK;
}
- cache_->ConvertWriterToReader(entry_);
- mode_ = READ;
+ if (entry_) {
rvargas (doing something else) 2011/06/23 19:00:27 The state machine guarantees that there should be
Greg Billock 2011/06/23 20:13:25 Done. I'll mark this intentional in coverity.
+ cache_->ConvertWriterToReader(entry_);
+ mode_ = READ;
+ }
if (entry_ && entry_->disk_entry->GetDataSize(kMetadataIndex))
next_state_ = STATE_CACHE_READ_METADATA;
« no previous file with comments | « no previous file | remoting/base/decompressor_zlib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698