From: Seunghun Lee Date: Thu, 18 Aug 2022 08:49:13 +0000 (+0900) Subject: data_device: Fix null-dereferencing X-Git-Tag: accepted/tizen/unified/20220823.131807~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25bfe0824c04cb9adeeba64c8246716dfefa781d;p=platform%2Fcore%2Fuifw%2Flibds.git data_device: Fix null-dereferencing Change-Id: I8f9ad9e1be245812d29d479dc8d4878126d7baba --- diff --git a/src/data_device/drag.c b/src/data_device/drag.c index 1c74bf6..c13acb4 100644 --- a/src/data_device/drag.c +++ b/src/data_device/drag.c @@ -571,18 +571,22 @@ drag_enter(struct ds_drag *drag, struct ds_surface *surface, ds_seat_client_get_wl_client(drag->seat_client))) return; - drag->source->accepted = false; + if (drag->source) { + drag->source->accepted = false; - data_device = data_device_for_seat_client(drag->data_device->manager, - focused_client); - if (!data_device) - return; + data_device = data_device_for_seat_client(drag->data_device->manager, + focused_client); + if (!data_device) + return; - if (data_device_send_drag_enter(data_device, drag->source, - surface_resource, sx, sy)) { - drag->focused_surface = surface; - drag_set_focus_client(drag, focused_client); + if (data_device_send_drag_enter(data_device, drag->source, + surface_resource, sx, sy)) { + return; + } } + + drag->focused_surface = surface; + drag_set_focus_client(drag, focused_client); } static void