Bug 829858 - Null dereference in nsHttpChannel::InitOfflineCacheEntry(). r=bsmith, a=lsblakk
authorHonza Bambas <honzab.moz@firemni.cz>
Mon, 14 Jan 2013 19:03:07 +0100
changeset 127181 57862e458e63435091a405ed11f0d990adb694a8
parent 127180 3c9f221756b63d635f9a61a01eccedd820bd84e5
child 127182 87a809f235a232016112863697a4b8eb2a36afa0
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmith, lsblakk
bugs829858
milestone20.0a2
Bug 829858 - Null dereference in nsHttpChannel::InitOfflineCacheEntry(). r=bsmith, a=lsblakk
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3614,23 +3614,23 @@ nsHttpChannel::InitOfflineCacheEntry()
 {
     // This function can be called even when we fail to connect (bug 551990)
 
     if (!mOfflineCacheEntry) {
         return NS_OK;
     }
 
     if (!mResponseHead || mResponseHead->NoStore()) {
-        if (mResponseHead->NoStore()) {
+        if (mResponseHead && mResponseHead->NoStore()) {
             mOfflineCacheEntry->AsyncDoom(nullptr);
         }
 
         CloseOfflineCacheEntry();
 
-        if (mResponseHead->NoStore()) {
+        if (mResponseHead && mResponseHead->NoStore()) {
             return NS_ERROR_NOT_AVAILABLE;
         }
 
         return NS_OK;
     }
 
     // This entry's expiration time should match the main entry's expiration
     // time.  UpdateExpirationTime() will keep it in sync once the offline