raster pushed a commit to branch master.

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

commit 4d7edf623b8d66bc3925589e2c0c6f36e0fdf978
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Dec 11 19:38:46 2013 +0900

    ephysics - fix real access-after-free issue on delete of constraint
    
    this fixes CID 1039895
---
 src/lib/ephysics/ephysics_constraints.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/ephysics/ephysics_constraints.cpp 
b/src/lib/ephysics/ephysics_constraints.cpp
index 5e36fcb..7fcc4b5 100644
--- a/src/lib/ephysics/ephysics_constraints.cpp
+++ b/src/lib/ephysics/ephysics_constraints.cpp
@@ -403,10 +403,12 @@ ephysics_constraint_del(EPhysics_Constraint *constraint)
         return;
      }
 
-   ephysics_world_lock_take(constraint->world);
+   // technically at this point locking and unlocking is pointless because
+   // if another thread is accessing this constraint, after this point it
+   // will be broken locks or not. this removes a segv in locking something
+   // we freed in _ephysics_constraint_del() by not locking.
    _ephysics_constraint_del(constraint);
    INF("Constraint deleted.");
-   ephysics_world_lock_release(constraint->world);
 }
 
 

-- 


Reply via email to