dnd: Be safer

The contents of the selection are documented
to not be NULL if size is non-negative. So
use an empty string instead of NULL for size 0,
avoiding a crash.
This commit is contained in:
Matthias Clasen 2019-12-31 16:03:33 -05:00
parent 4b818495ca
commit e02fd80adb

View File

@ -171,7 +171,7 @@ gtk_drag_get_data_finish (GtkDragGetData *data,
sdata.type = data->mime_type;
sdata.format = 8;
sdata.length = size;
sdata.data = bytes;
sdata.data = bytes ? bytes : (guchar *)g_strdup ("");
sdata.display = gtk_widget_get_display (data->widget);
if (site && site->target_list)