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

Unified Diff: webkit/appcache/appcache_response.cc

Issue 7054077: Fix a null pointer crasher. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 | webkit/appcache/appcache_update_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_response.cc
===================================================================
--- webkit/appcache/appcache_response.cc (revision 88004)
+++ webkit/appcache/appcache_response.cc (working copy)
@@ -214,12 +214,16 @@
void AppCacheResponseReader::OnIOComplete(int result) {
if (result >= 0) {
if (info_buffer_.get()) {
- // Allocate and deserialize the http info structure.
+ // Deserialize the http info structure.
Pickle pickle(buffer_->data(), result);
+ scoped_ptr<net::HttpResponseInfo> info(new net::HttpResponseInfo);
bool response_truncated = false;
- info_buffer_->http_info.reset(new net::HttpResponseInfo);
- info_buffer_->http_info->InitFromPickle(pickle, &response_truncated);
+ if (!info->InitFromPickle(pickle, &response_truncated)) {
+ InvokeUserCompletionCallback(net::ERR_FAILED);
+ return;
+ }
DCHECK(!response_truncated);
+ info_buffer_->http_info.reset(info.release());
// Also return the size of the response body
DCHECK(entry_);
« no previous file with comments | « no previous file | webkit/appcache/appcache_update_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698