[mutter/gnome-41] selection: Return an error if trying to transfer from NULL source



commit d92385eb9e23bb86512a894e1f634ee6e6c91212
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Apr 6 10:04:05 2022 +0200

    selection: Return an error if trying to transfer from NULL source
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2364>

 src/core/meta-selection.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/core/meta-selection.c b/src/core/meta-selection.c
index 76c3420201..411db4971e 100644
--- a/src/core/meta-selection.c
+++ b/src/core/meta-selection.c
@@ -438,6 +438,13 @@ meta_selection_transfer_async (MetaSelection        *selection,
   task = g_task_new (selection, cancellable, callback, user_data);
   g_task_set_source_tag (task, meta_selection_transfer_async);
 
+  if (!selection->owners[selection_type])
+    {
+      g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+                               "Tried to transfer from NULL selection source");
+      return;
+    }
+
   transfer_request = transfer_request_new (output, selection_type, size,
                                            cancellable);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]