summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Popov <artem.popov@samsung.com>2016-07-04 10:49:55 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-04 11:01:05 +0900
commit71a0573187a7128332100cc96131d35ae1846f67 (patch)
treeeee1411987c93fe7f687f4642cc4f3644e32dd27
parent3627fa7883aee310f2966f5562f4a0e5cf7a5d58 (diff)
Elementary: cnp - check on NULL data in elm_drag_start
Summary: check on NULL add in wayland elm_drag_start API @fix Test Plan: Call elm_grag_start with data = NULL under wayland Reviewers: zmike, NikaWhite, jpeg Reviewed By: NikaWhite, jpeg Subscribers: bu5hm4n, myoungwoon, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4119
-rw-r--r--src/lib/elementary/elm_cnp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
index a7f81eefb5..855e7d8add 100644
--- a/src/lib/elementary/elm_cnp.c
+++ b/src/lib/elementary/elm_cnp.c
@@ -3345,8 +3345,13 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
3345 3345
3346 /* set the drag data used when a drop occurs */ 3346 /* set the drag data used when a drop occurs */
3347 free(wl_cnp_selection.selbuf); 3347 free(wl_cnp_selection.selbuf);
3348 wl_cnp_selection.selbuf = strdup((char*)data); 3348 wl_cnp_selection.buflen = 0;
3349 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf); 3349 wl_cnp_selection.selbuf = eina_strdup(data);
3350
3351 if (data)
3352 {
3353 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
3354 }
3350 3355
3351 /* setup callback to notify if this object gets deleted */ 3356 /* setup callback to notify if this object gets deleted */
3352 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, 3357 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,