jaehyun pushed a commit to branch master.

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

commit cb059ea0afde20535d1521da510f74411b96a605
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Mon Sep 7 14:35:12 2020 +0900

    elm_gesture_layer: fix crash caused by elm_gesture_layer_cb_del in cb
    
    elm_gesture_layer_cb_del can be called in Elm_Gesture_Event_Cb cb set by
    elm_gesture_layer_cb_set and cb_info of the cb is free in the cb.
    
    This causes crash if cb_info is searched with EINA_INLIST_FOREACH.
---
 src/lib/elementary/elm_gesture_layer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/elm_gesture_layer.c 
b/src/lib/elementary/elm_gesture_layer.c
index e7fb88348c..5e6932c0af 100644
--- a/src/lib/elementary/elm_gesture_layer.c
+++ b/src/lib/elementary/elm_gesture_layer.c
@@ -614,8 +614,10 @@ _state_report(Gesture_Info *gesture,
                                         * send ptr to user
                                         * callback */
      {
+        Eina_Inlist *itr;
         Func_Data *cb_info;
-        EINA_INLIST_FOREACH(gesture->cbs[gesture->state], cb_info)
+        /* elm_gesture_layer_cb_del can be called in Elm_Gesture_Event_Cb cb */
+        EINA_INLIST_FOREACH_SAFE(gesture->cbs[gesture->state], itr, cb_info)
            flags |= cb_info->cb(cb_info->user_data, info);
      }
 

-- 


Reply via email to