From aa11ddf32cd56722a771d85ade228b9525ac4db8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Mar 2020 08:20:44 +0530 Subject: [PATCH] Wayland: Fix a crash when drag and dropping into kitty Fixes #2432 --- docs/changelog.rst | 2 ++ glfw/wl_window.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index b6d15c72c..a201a5fd1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -73,6 +73,8 @@ To update |kitty|, :doc:`follow the instructions `. - Drop support for python 3.5 +- Wayland: Fix a crash when drag and dropping into kitty (:iss:`2432`) + 0.16.0 [2020-01-28] -------------------- diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 542c708d2..654db611b 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -1761,14 +1761,14 @@ static void drag_leave(void *data UNUSED, struct wl_data_device *wl_data_device } } -static void drop(void *data, struct wl_data_device *wl_data_device UNUSED) { +static void drop(void *data UNUSED, struct wl_data_device *wl_data_device UNUSED) { for (size_t i = 0; i < arraysz(_glfw.wl.dataOffers); i++) { if (_glfw.wl.dataOffers[i].offer_type == DRAG_AND_DROP) { char *uri_list = read_data_offer(_glfw.wl.dataOffers[i].id, URI_LIST_MIME); if (uri_list) { wl_data_offer_finish(_glfw.wl.dataOffers[i].id); int count; - char** paths = parseUriList(data, &count); + char** paths = parseUriList(uri_list, &count); _GLFWwindow* window = _glfw.windowListHead; while (window)