Commit 0a0d8235 authored by graouts@apple.com's avatar graouts@apple.com

Creating a WebInspector.ContextMenu without an event crashes WebCore when calling .show()

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

Reviewed by Pavel Feldman.

Return early if InspectorFrontendHost::showContextMenu() is called without an event and
assert in ContextMenuController::createContextMenu() in case no event was provided.

* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::createContextMenu):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 625a11a7
2013-02-02 Antoine Quint <graouts@apple.com>
Creating a WebInspector.ContextMenu without an event crashes WebCore when calling .show()
https://bugs.webkit.org/show_bug.cgi?id=108636
Reviewed by Pavel Feldman.
Return early if InspectorFrontendHost::showContextMenu() is called without an event and
assert in ContextMenuController::createContextMenu() in case no event was provided.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::createContextMenu):
2013-02-02 Jonathan Feldstein <jfeldstein@rim.com>
[BlackBerry] Improper initialization of ANGLEResources
......@@ -269,6 +269,9 @@ void InspectorFrontendHost::sendMessageToBackend(const String& message)
#if ENABLE(CONTEXT_MENUS)
void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem>& items)
{
if (!event)
return;
ASSERT(m_frontendPage);
ScriptState* frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
ScriptObject frontendApiObject;
......
......@@ -142,6 +142,8 @@ void ContextMenuController::showContextMenu(Event* event, PassRefPtr<ContextMenu
PassOwnPtr<ContextMenu> ContextMenuController::createContextMenu(Event* event)
{
ASSERT(event);
if (!event->isMouseEvent())
return nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment