Skip to content

Commit

Permalink
Merge r247507 - [GTK][WPE] Do not assert when receiving invalid data …
Browse files Browse the repository at this point in the history
…in injected bundle messages

https://bugs.webkit.org/show_bug.cgi?id=199830

Reviewed by Michael Catanzaro.

Just silently ignore them to avoid UI process crashes.

* UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
  • Loading branch information
carlosgcampos authored and mcatanzaro committed Aug 4, 2019
1 parent 7f087e6 commit 65f6dac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,14 @@
2019-07-17 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK][WPE] Do not assert when receiving invalid data in injected bundle messages
https://bugs.webkit.org/show_bug.cgi?id=199830

Reviewed by Michael Catanzaro.

Just silently ignore them to avoid UI process crashes.

* UIProcess/API/glib/WebKitInjectedBundleClient.cpp:

2019-05-06 Alex Christensen <achristensen@webkit.org>

Null check m_mainFrame in WebPageProxy.cpp
Expand Down
10 changes: 5 additions & 5 deletions Source/WebKit/UIProcess/API/glib/WebKitInjectedBundleClient.cpp
Expand Up @@ -110,13 +110,14 @@ class WebKitInjectedBundleClient final : public API::InjectedBundleClient {
WebImage* image = static_cast<WebImage*>(message.get("Snapshot"));
webKitWebViewDidReceiveSnapshot(webView, callbackID->value(), image);
#endif
} else
ASSERT_NOT_REACHED();
}
}

void didReceiveMessageFromInjectedBundle(WebProcessPool&, const String& messageName, API::Object* messageBody) override
{
ASSERT(messageBody->type() == API::Object::Type::Dictionary);
if (messageBody->type() != API::Object::Type::Dictionary)
return;

API::Dictionary& message = *static_cast<API::Dictionary*>(messageBody);

CString messageNameUTF8 = messageName.utf8();
Expand All @@ -127,8 +128,7 @@ class WebKitInjectedBundleClient final : public API::InjectedBundleClient {
return;

didReceiveWebViewMessageFromInjectedBundle(webView, messageNameUTF8.data() + strlen("WebPage."), message);
} else
ASSERT_NOT_REACHED();
}
}

RefPtr<API::Object> getInjectedBundleInitializationUserData(WebProcessPool&)
Expand Down

0 comments on commit 65f6dac

Please sign in to comment.