raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=82841fefe30df6a406cf549db60daf806c5f10eb

commit 82841fefe30df6a406cf549db60daf806c5f10eb
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Dec 9 18:39:07 2013 +0900

    fix seb "fix" commit that causes lots of segvs.
    
    this fixes 04e0a6d95ec5610e35febbbb9b1be1a361f177ae which introduced
    copy & paste segv's by properly terminating the right buffer.
---
 doc/images.mk                            |  2 +-
 src/lib/ecore_x/xlib/ecore_x_selection.c | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/doc/images.mk b/doc/images.mk
index b2d8045..20d8d63 100644
--- a/doc/images.mk
+++ b/doc/images.mk
@@ -1,2 +1,2 @@
 EXTRA_DIST += \
-img/01_hash-table.eps img/01_hash-table.png img/alignment-hints.eps 
img/alignment-hints.png img/any-policy.eps img/any-policy.png 
img/aspect-control-both.eps img/aspect-control-both.png 
img/aspect-control-horizontal.eps img/aspect-control-horizontal.png 
img/aspect-control-none-neither.eps img/aspect-control-none-neither.png 
img/b1.png img/b2.png img/b3.png img/b4.png img/b5.png img/b6.png img/b7.png 
img/b8.png img/b9.png img/basic2final.eps img/basic2final.png 
img/border-effect.eps img/b [...]
+img/01_hash-table.eps img/01_hash-table.png img/alignment-hints.eps 
img/alignment-hints.png img/any-policy.eps img/any-policy.png 
img/aspect-control-both.eps img/aspect-control-both.png 
img/aspect-control-horizontal.eps img/aspect-control-horizontal.png 
img/aspect-control-none-neither.eps img/aspect-control-none-neither.png 
img/b1.png img/b2.png img/b3.png img/b4.png img/b5.png img/b6.png img/b7.png 
img/b8.png img/b9.png img/basic2final.eps img/basic2final.png 
img/border-effect.eps img/b [...]
diff --git a/src/lib/ecore_x/xlib/ecore_x_selection.c 
b/src/lib/ecore_x/xlib/ecore_x_selection.c
index 0bbd601..13a24fc 100644
--- a/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -599,13 +599,11 @@ ecore_x_selection_converter_text(char *target,
                                    &text_prop) == Success)
      {
         int bufsize = strlen((char *)text_prop.value);
-        *data_ret = malloc(bufsize + 1);
-        if (!*data_ret)
-          {
-             return EINA_FALSE;
-          }
-        memcpy(*data_ret, text_prop.value, bufsize);
-        ((char **)data_ret)[bufsize] = 0;
+        char *s = malloc(bufsize + 1);
+        if (!s) return EINA_FALSE;
+        *data_ret = s;
+        memcpy(s, text_prop.value, bufsize);
+        s[bufsize] = 0;
         *size_ret = bufsize;
         XFree(text_prop.value);
         return EINA_TRUE;

-- 


Reply via email to