Hello,

I have attached a patch (and a backport patch) with a fix for ecore. I
tried to achieve vtorri compliance (AUTHORS, NEWS, ChangeLog, backport).


Regards,
Daniel Willmann

From a0b95925bc397293f6d94ae5d58172d24309d737 Mon Sep 17 00:00:00 2001
From: Daniel Willmann <[email protected]>
Date: Tue, 2 Oct 2012 16:15:46 +0100
Subject: [PATCH 1/5] ecore: Fix memory corruption in ecore_thread_feedback()

malloc sizeof(type) vs. sizeof(type*)
Cudos to Klocwork for finding this.

Signed-off-by: Daniel Willmann <[email protected]>
---
 trunk/ecore/AUTHORS                      |    1 +
 trunk/ecore/ChangeLog                    |    4 ++++
 trunk/ecore/NEWS                         |    1 +
 trunk/ecore/src/lib/ecore/ecore_thread.c |    2 +-
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/trunk/ecore/AUTHORS b/trunk/ecore/AUTHORS
index e16e1e8..ff9f752 100644
--- a/trunk/ecore/AUTHORS
+++ b/trunk/ecore/AUTHORS
@@ -54,3 +54,4 @@ J챕r챕my Zurcher <[email protected]>
 Vikram Narayanan <[email protected]>
 Seong-ho Cho (DarkCircle) <[email protected]>
 Patryk Kaczmarek <[email protected]>
+Daniel Willmann <[email protected]>
diff --git a/trunk/ecore/ChangeLog b/trunk/ecore/ChangeLog
index 4d7f47c..bc7a925 100644
--- a/trunk/ecore/ChangeLog
+++ b/trunk/ecore/ChangeLog
@@ -970,3 +970,7 @@
 
        * Fix ecore_imf buf in the ibus module where it may segv
        accessing a wrong context handle.
+
+2012-10-02  Daniel Willmann
+
+       * Fix memory allocation size in ecore_thread_feedback()
diff --git a/trunk/ecore/NEWS b/trunk/ecore/NEWS
index 97bb9ff..efd4455 100644
--- a/trunk/ecore/NEWS
+++ b/trunk/ecore/NEWS
@@ -25,6 +25,7 @@ Fixes:
     * ecore_file_escape_name() escape taba nd newline right.
     * ecore_x_image_is_argb32_get() returns correctly given endianness.
     * ecore_imf ibus module potential segv fixed.
+    * ecore_thread_feedback() memory allocation and corruption fixed.
 
 Improvements:
 
diff --git a/trunk/ecore/src/lib/ecore/ecore_thread.c b/trunk/ecore/src/lib/ecore/ecore_thread.c
index 87688ed..5c6880b 100644
--- a/trunk/ecore/src/lib/ecore/ecore_thread.c
+++ b/trunk/ecore/src/lib/ecore/ecore_thread.c
@@ -1107,7 +1107,7 @@ ecore_thread_feedback(Ecore_Thread *thread,
         Ecore_Pthread_Message *msg;
         Ecore_Pthread_Notify *notify;
 
-        msg = malloc(sizeof (Ecore_Pthread_Message*));
+        msg = malloc(sizeof (Ecore_Pthread_Message));
         if (!msg) return EINA_FALSE;
         msg->data = data;
         msg->callback = EINA_FALSE;
-- 
1.7.9.5


From 2a0d8b4a2fb3139ab95c9d777ff15a04f6a3b4a1 Mon Sep 17 00:00:00 2001
From: Daniel Willmann <[email protected]>
Date: Tue, 2 Oct 2012 16:24:02 +0100
Subject: [PATCH 2/5] ecore: Fix memory corruption in ecore_thread_feedback()

Backport to 1.7
malloc sizeof(type) vs. sizeof(type*)
Cudos to Klocwork for finding this.

Signed-off-by: Daniel Willmann <[email protected]>
---
 branches/ecore-1.7/AUTHORS                      |    1 +
 branches/ecore-1.7/ChangeLog                    |    6 +++++-
 branches/ecore-1.7/NEWS                         |    1 +
 branches/ecore-1.7/src/lib/ecore/ecore_thread.c |    2 +-
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/branches/ecore-1.7/AUTHORS b/branches/ecore-1.7/AUTHORS
index 83bc535..1ab381b 100644
--- a/branches/ecore-1.7/AUTHORS
+++ b/branches/ecore-1.7/AUTHORS
@@ -53,3 +53,4 @@ Haifeng Deng <[email protected]>
 J챕r챕my Zurcher <[email protected]>
 Vikram Narayanan <[email protected]>
 Patryk Kaczmarek <[email protected]>
+Daniel Willmann <[email protected]>
diff --git a/branches/ecore-1.7/ChangeLog b/branches/ecore-1.7/ChangeLog
index 5fc5852..6f2df29 100644
--- a/branches/ecore-1.7/ChangeLog
+++ b/branches/ecore-1.7/ChangeLog
@@ -952,4 +952,8 @@
 
        * Fix ecore_imf buf in the ibus module where it may segv
        accessing a wrong context handle.
-              
+
+2012-10-02  Daniel Willmann
+
+       * Fix memory allocation size in ecore_thread_feedback()
+
diff --git a/branches/ecore-1.7/NEWS b/branches/ecore-1.7/NEWS
index 79e57cf..8397a8c 100644
--- a/branches/ecore-1.7/NEWS
+++ b/branches/ecore-1.7/NEWS
@@ -8,6 +8,7 @@ Fixes:
     * ecore_file_escape_name() escape taba nd newline right.
     * ecore_x_image_is_argb32_get() returns correctly given endianness.
     * ecore_imf ibus module potential segv fixed.
+    * ecore_thread_feedback() memory allocation and corruption fixed.
     
 Changes since Ecore 1.2.0:
 --------------------------
diff --git a/branches/ecore-1.7/src/lib/ecore/ecore_thread.c b/branches/ecore-1.7/src/lib/ecore/ecore_thread.c
index 87688ed..5c6880b 100644
--- a/branches/ecore-1.7/src/lib/ecore/ecore_thread.c
+++ b/branches/ecore-1.7/src/lib/ecore/ecore_thread.c
@@ -1107,7 +1107,7 @@ ecore_thread_feedback(Ecore_Thread *thread,
         Ecore_Pthread_Message *msg;
         Ecore_Pthread_Notify *notify;
 
-        msg = malloc(sizeof (Ecore_Pthread_Message*));
+        msg = malloc(sizeof (Ecore_Pthread_Message));
         if (!msg) return EINA_FALSE;
         msg->data = data;
         msg->callback = EINA_FALSE;
-- 
1.7.9.5


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to