Skip to content
Permalink
Browse files
[WTR] Crash in EventSendingController::contextClick() when context me…
…nu event is not handled

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

Reviewed by Martin Robinson.

WKBundlePageCopyContextMenuAtPointInWindow() returns nullptr when
the context menu event is not hanlded, but we are using the
returned value without null checking it.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::contextClick):

Canonical link: https://commits.webkit.org/171960@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Feb 4, 2016
1 parent 29f4a7c commit 747eadaa674299bb515f966aa335f91ed6819872
Showing 2 changed files with 17 additions and 0 deletions.
@@ -1,3 +1,17 @@
2016-02-03 Carlos Garcia Campos <cgarcia@igalia.com>

[WTR] Crash in EventSendingController::contextClick() when context menu event is not handled
https://bugs.webkit.org/show_bug.cgi?id=153835

Reviewed by Martin Robinson.

WKBundlePageCopyContextMenuAtPointInWindow() returns nullptr when
the context menu event is not hanlded, but we are using the
returned value without null checking it.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::contextClick):

2016-02-03 Jason Marcell <jmarcell@apple.com>

Format revisions for display according to repository type
@@ -554,6 +554,9 @@ JSValueRef EventSendingController::contextClick()
WKRetainPtr<WKArrayRef> menuEntries = adoptWK(WKBundlePageCopyContextMenuAtPointInWindow(page, m_position));
#endif
JSValueRef arrayResult = JSObjectMakeArray(context, 0, 0, 0);
if (!menuEntries)
return arrayResult;

JSObjectRef arrayObj = JSValueToObject(context, arrayResult, 0);
size_t entriesSize = WKArrayGetSize(menuEntries.get());
for (size_t i = 0; i < entriesSize; ++i) {

0 comments on commit 747eada

Please sign in to comment.