Title: [185896] trunk/Source/WebKit2
Revision
185896
Author
mcatanz...@igalia.com
Date
2015-06-23 19:04:38 -0700 (Tue, 23 Jun 2015)

Log Message

[GTK] Crash performing drag-and-drop
https://bugs.webkit.org/show_bug.cgi?id=146267

Reviewed by Darin Adler.

Return early if gtk_get_current_event() returns null to avoid a crash. Note that this does
not fix drag-and-drop. Note also this prevents the web process from forcing the UI process
to crash by sending fake startDrag messages.

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::startDrag):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185895 => 185896)


--- trunk/Source/WebKit2/ChangeLog	2015-06-24 02:00:52 UTC (rev 185895)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-24 02:04:38 UTC (rev 185896)
@@ -1,3 +1,17 @@
+2015-06-23  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        [GTK] Crash performing drag-and-drop
+        https://bugs.webkit.org/show_bug.cgi?id=146267
+
+        Reviewed by Darin Adler.
+
+        Return early if gtk_get_current_event() returns null to avoid a crash. Note that this does
+        not fix drag-and-drop. Note also this prevents the web process from forcing the UI process
+        to crash by sending fake startDrag messages.
+
+        * UIProcess/gtk/DragAndDropHandler.cpp:
+        (WebKit::DragAndDropHandler::startDrag):
+
 2015-06-23  Anders Carlsson  <ander...@apple.com>
 
         Add a class that tracks whether we're a background or foreground application

Modified: trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp (185895 => 185896)


--- trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp	2015-06-24 02:00:52 UTC (rev 185895)
+++ trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp	2015-06-24 02:04:38 UTC (rev 185896)
@@ -114,6 +114,9 @@
     GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
     GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
 
+    if (!currentEvent)
+        return;
+
     GdkDragContext* context = gtk_drag_begin(m_page.viewWidget(), targetList.get(), dragOperationToGdkDragActions(dragData.draggingSourceOperationMask()),
         GDK_BUTTON_PRIMARY, currentEvent.get());
     m_draggingDataObjects.set(context, dataObject.get());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to