ecore_wl: modify the length of read buffer 81/86581/3
authorMinchul Lee <slotus.lee@samsung.com>
Fri, 2 Sep 2016 03:49:37 +0000 (12:49 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 5 Sep 2016 03:49:44 +0000 (20:49 -0700)
Change-Id: I8955f50f840799da8e1075207a590783454405d9

src/lib/ecore_wayland/ecore_wl_dnd.c

index b8143d3..5076aa1 100644 (file)
@@ -713,7 +713,11 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
         char **types;
         int num = 0;
         //
-        event->data = malloc(len);
+
+        // TIZEN_ONLY(20160902): Modify data allocation size
+        //event->data = malloc(len);
+        event->data = malloc(len + 1);
+        //
         if (!event->data)
           {
              free(event);
@@ -722,6 +726,8 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
         memcpy(event->data, buffer, len);
 
         // TIZEN_ONLY(20160707): To distinguish clipboard selection in cbhm
+        event->data[len] = '\0';
+
         num = (source->types.size / sizeof(char *));
         types = source->types.data;