jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=71a0573187a7128332100cc96131d35ae1846f67

commit 71a0573187a7128332100cc96131d35ae1846f67
Author: Artem Popov <[email protected]>
Date:   Mon Jul 4 10:49:55 2016 +0900

    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
---
 src/lib/elementary/elm_cnp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
index a7f81ee..855e7d8 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,
 
    /* set the drag data used when a drop occurs */
    free(wl_cnp_selection.selbuf);
-   wl_cnp_selection.selbuf = strdup((char*)data);
-   wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
+   wl_cnp_selection.buflen = 0;
+   wl_cnp_selection.selbuf = eina_strdup(data);
+
+   if (data)
+     {
+        wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
+     }
 
    /* setup callback to notify if this object gets deleted */
    evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,

-- 


Reply via email to