Skip to content
Permalink
Browse files
Harden our access to the vector of URL schemes.
https://bugs.webkit.org/show_bug.cgi?id=177470
<rdar://problem/33881522>

Reviewed by Chris Dumez.

Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::stopURLSchemeTask):


Canonical link: https://commits.webkit.org/193812@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
brentfulgham committed Sep 26, 2017
1 parent 130caf0 commit 196d7209f2c3f5ab63f01a107b0d429f9d1ab8e8
Showing with 16 additions and 2 deletions.
  1. +14 −0 Source/WebKit/ChangeLog
  2. +2 −2 Source/WebKit/UIProcess/WebPageProxy.cpp
@@ -1,3 +1,17 @@
2017-09-26 Brent Fulgham <bfulgham@apple.com>

Harden our access to the vector of URL schemes.
https://bugs.webkit.org/show_bug.cgi?id=177470
<rdar://problem/33881522>

Reviewed by Chris Dumez.

Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::stopURLSchemeTask):

2017-09-26 Jer Noble <jer.noble@apple.com>

Thrown ObjC exception when right clicking on <img> containing mp4 link
@@ -7021,15 +7021,15 @@ WebURLSchemeHandler* WebPageProxy::urlSchemeHandlerForScheme(const String& schem
void WebPageProxy::startURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier, const WebCore::ResourceRequest& request)
{
auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier);
ASSERT(iterator != m_urlSchemeHandlersByIdentifier.end());
MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end());

iterator->value->startTask(*this, taskIdentifier, request);
}

void WebPageProxy::stopURLSchemeTask(uint64_t handlerIdentifier, uint64_t taskIdentifier)
{
auto iterator = m_urlSchemeHandlersByIdentifier.find(handlerIdentifier);
ASSERT(iterator != m_urlSchemeHandlersByIdentifier.end());
MESSAGE_CHECK(iterator != m_urlSchemeHandlersByIdentifier.end());

iterator->value->stopTask(*this, taskIdentifier);
}

0 comments on commit 196d720

Please sign in to comment.