Title: [247304] branches/safari-608.1.34.1-branch/Source/WebCore
Revision
247304
Author
[email protected]
Date
2019-07-10 09:09:36 -0700 (Wed, 10 Jul 2019)

Log Message

Cherry-pick r247266. rdar://problem/49884391

    Null check HistoryItems given to loadDifferentDocumentItem
    https://bugs.webkit.org/show_bug.cgi?id=199596
    <rdar://problem/49884391>

    Reviewed by Ryosuke Niwa.

    * loader/FrameLoader.cpp:
    (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
    Under some rare and mysterious conditions we can have a null provisionalItem when loading from the cache.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608.1.34.1-branch/Source/WebCore/ChangeLog (247303 => 247304)


--- branches/safari-608.1.34.1-branch/Source/WebCore/ChangeLog	2019-07-10 16:09:31 UTC (rev 247303)
+++ branches/safari-608.1.34.1-branch/Source/WebCore/ChangeLog	2019-07-10 16:09:36 UTC (rev 247304)
@@ -1,5 +1,35 @@
 2019-07-10  Alan Coon  <[email protected]>
 
+        Cherry-pick r247266. rdar://problem/49884391
+
+    Null check HistoryItems given to loadDifferentDocumentItem
+    https://bugs.webkit.org/show_bug.cgi?id=199596
+    <rdar://problem/49884391>
+    
+    Reviewed by Ryosuke Niwa.
+    
+    * loader/FrameLoader.cpp:
+    (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
+    Under some rare and mysterious conditions we can have a null provisionalItem when loading from the cache.
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-09  Alex Christensen  <[email protected]>
+
+            Null check HistoryItems given to loadDifferentDocumentItem
+            https://bugs.webkit.org/show_bug.cgi?id=199596
+            <rdar://problem/49884391>
+
+            Reviewed by Ryosuke Niwa.
+
+            * loader/FrameLoader.cpp:
+            (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
+            Under some rare and mysterious conditions we can have a null provisionalItem when loading from the cache.
+
+2019-07-10  Alan Coon  <[email protected]>
+
         Cherry-pick r247231. rdar://problem/52640967
 
     Prevent null dereferencing in SubresourceLoader::init's lambda

Modified: branches/safari-608.1.34.1-branch/Source/WebCore/loader/FrameLoader.cpp (247303 => 247304)


--- branches/safari-608.1.34.1-branch/Source/WebCore/loader/FrameLoader.cpp	2019-07-10 16:09:31 UTC (rev 247303)
+++ branches/safari-608.1.34.1-branch/Source/WebCore/loader/FrameLoader.cpp	2019-07-10 16:09:36 UTC (rev 247304)
@@ -3868,10 +3868,15 @@
     ASSERT(history().provisionalItem() == m_requestedHistoryItem.get());
 
     FrameLoadType loadType = m_loadType;
-    HistoryItem& item = *history().provisionalItem();
+    HistoryItem* item = history().provisionalItem();
 
     stopAllLoaders(ShouldNotClearProvisionalItem);
-    loadDifferentDocumentItem(item, history().currentItem(), loadType, MayNotAttemptCacheOnlyLoadForFormSubmissionItem, ShouldTreatAsContinuingLoad::No);
+    if (item)
+        loadDifferentDocumentItem(*item, history().currentItem(), loadType, MayNotAttemptCacheOnlyLoadForFormSubmissionItem, ShouldTreatAsContinuingLoad::No);
+    else {
+        ASSERT_NOT_REACHED();
+        RELEASE_LOG_ERROR(ResourceLoading, "Retrying load after failed cache-only main resource load failed because there is no provisional history item.");
+    }
 }
 
 ResourceError FrameLoader::cancelledError(const ResourceRequest& request) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to