Skip to content

Commit

Permalink
Merge r185896 - [GTK] Crash performing drag-and-drop
Browse files Browse the repository at this point in the history
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):
  • Loading branch information
mcatanzaro authored and carlosgcampos committed Jul 7, 2015
1 parent daa5c80 commit a103bd3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
2015-06-23 Michael Catanzaro <mcatanzaro@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-22 Gyuyoung Kim <gyuyoung.kim@webkit.org>

[EFL][CustomProtocol] Do not add duplicated custom scheme
Expand Down
3 changes: 3 additions & 0 deletions Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp
Expand Up @@ -114,6 +114,9 @@ void DragAndDropHandler::startDrag(const DragData& dragData, PassRefPtr<Shareabl
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());
Expand Down

0 comments on commit a103bd3

Please sign in to comment.