cedric pushed a commit to branch efl-1.16.

http://git.enlightenment.org/core/efl.git/commit/?id=6ebb508796ac2eea2c65c9245e989e6b5982398c

commit 6ebb508796ac2eea2c65c9245e989e6b5982398c
Author: Shinwoo Kim <cinoo....@samsung.com>
Date:   Tue Nov 10 13:45:37 2015 -0800

    ecore: thread - need to null check of function pointer
    
    Summary: you can meet a segmentation fault without this patch
    
    Test Plan:
    please use the following snippet
       Ecore_Thread  *th;
       th = ecore_thread_feedback_run(_heavy_cb, _notify_cb, NULL, NULL, obj, 
EINA_TRUE);
       ecore_thread_wait(th, 1.0);
    
    Reviewers: raster, Hermet, jaehwan, woohyun, cedric
    
    Reviewed By: cedric
    
    Subscribers: seoz
    
    Differential Revision: https://phab.enlightenment.org/D3315
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/ecore/ecore_thread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c
index befb0fb..6a68d6b 100644
--- a/src/lib/ecore/ecore_thread.c
+++ b/src/lib/ecore/ecore_thread.c
@@ -762,7 +762,7 @@ _ecore_thread_wait_cancel(void *data, Ecore_Thread *thread)
    Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
    Ecore_Thread_Waiter *waiter = data;
 
-   waiter->func_cancel((void*) waiter->data, thread);
+   if (waiter->func_cancel) waiter->func_cancel((void*) waiter->data, thread);
    _ecore_thread_wait_reset(waiter, worker);
 }
 
@@ -772,7 +772,7 @@ _ecore_thread_wait_end(void *data, Ecore_Thread *thread)
    Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
    Ecore_Thread_Waiter *waiter = data;
 
-   waiter->func_end((void*) waiter->data, thread);
+   if (waiter->func_end) waiter->func_end((void*) waiter->data, thread);
    _ecore_thread_wait_reset(waiter, worker);
 }
 

-- 


Reply via email to