Title: [253181] trunk/Source
Revision
253181
Author
[email protected]
Date
2019-12-05 15:53:18 -0800 (Thu, 05 Dec 2019)

Log Message

[IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
https://bugs.webkit.org/show_bug.cgi?id=204920
<rdar://problem/57677453>

Reviewed by Ryosuke Niwa.

Source/WebCore:

* history/BackForwardItemIdentifier.h:
(WebCore::BackForwardItemIdentifier::decode):

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateBackForwardItem):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (253180 => 253181)


--- trunk/Source/WebCore/ChangeLog	2019-12-05 23:52:01 UTC (rev 253180)
+++ trunk/Source/WebCore/ChangeLog	2019-12-05 23:53:18 UTC (rev 253181)
@@ -1,3 +1,14 @@
+2019-12-05  Chris Dumez  <[email protected]>
+
+        [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
+        https://bugs.webkit.org/show_bug.cgi?id=204920
+        <rdar://problem/57677453>
+
+        Reviewed by Ryosuke Niwa.
+
+        * history/BackForwardItemIdentifier.h:
+        (WebCore::BackForwardItemIdentifier::decode):
+
 2019-12-05  Sihui Liu  <[email protected]>
 
         Move InProcessIDBServer to WebKitLegacy

Modified: trunk/Source/WebCore/history/BackForwardItemIdentifier.h (253180 => 253181)


--- trunk/Source/WebCore/history/BackForwardItemIdentifier.h	2019-12-05 23:52:01 UTC (rev 253180)
+++ trunk/Source/WebCore/history/BackForwardItemIdentifier.h	2019-12-05 23:53:18 UTC (rev 253181)
@@ -90,7 +90,10 @@
     if (!itemIdentifier)
         return WTF::nullopt;
 
-    return { { WTFMove(*processIdentifier), WTFMove(*itemIdentifier) } };
+    BackForwardItemIdentifier result = { WTFMove(*processIdentifier), WTFMove(*itemIdentifier) };
+    if (!result.isValid())
+        return WTF::nullopt;
+    return result;
 }
 
 inline unsigned BackForwardItemIdentifier::hash() const

Modified: trunk/Source/WebKit/ChangeLog (253180 => 253181)


--- trunk/Source/WebKit/ChangeLog	2019-12-05 23:52:01 UTC (rev 253180)
+++ trunk/Source/WebKit/ChangeLog	2019-12-05 23:53:18 UTC (rev 253181)
@@ -1,3 +1,17 @@
+2019-12-05  Chris Dumez  <[email protected]>
+
+        [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
+        https://bugs.webkit.org/show_bug.cgi?id=204920
+        <rdar://problem/57677453>
+
+        Reviewed by Ryosuke Niwa.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::willGoToBackForwardListItem):
+        (WebKit::WebPageProxy::backForwardGoToItemShared):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::updateBackForwardItem):
+
 2019-12-05  Sihui Liu  <[email protected]>
 
         Move InProcessIDBServer to WebKitLegacy

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (253180 => 253181)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-12-05 23:52:01 UTC (rev 253180)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-12-05 23:53:18 UTC (rev 253181)
@@ -1573,8 +1573,6 @@
 
 void WebPageProxy::willGoToBackForwardListItem(const BackForwardItemIdentifier& itemID, bool inBackForwardCache)
 {
-    MESSAGE_CHECK(m_process, itemID.isValid());
-
     PageClientProtector protector(pageClient());
 
     if (auto* item = m_backForwardList->itemForID(itemID))
@@ -5927,8 +5925,6 @@
 
 void WebPageProxy::backForwardGoToItemShared(Ref<WebProcessProxy>&& process, const BackForwardItemIdentifier& itemID, CompletionHandler<void(SandboxExtension::Handle&&)>&& completionHandler)
 {
-    MESSAGE_CHECK(process, itemID.isValid());
-
     auto* item = m_backForwardList->itemForID(itemID);
     if (!item)
         return completionHandler({ });

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (253180 => 253181)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2019-12-05 23:52:01 UTC (rev 253180)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2019-12-05 23:53:18 UTC (rev 253181)
@@ -627,8 +627,6 @@
 
 void WebProcessProxy::updateBackForwardItem(const BackForwardListItemState& itemState)
 {
-    MESSAGE_CHECK(itemState.identifier.isValid());
-
     auto* item = WebBackForwardListItem::itemForID(itemState.identifier);
     if (!item || !isAllowedToUpdateBackForwardItem(*item))
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to