tasn pushed a commit to branch master.

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

commit fb8dfe98cd940acade1b6bfe3f15c202b9757380
Author: Tom Hacohen <t...@stosb.com>
Date:   Mon Feb 9 13:47:00 2015 +0000

    Eina tmpstr: fix race condition.
    
    We take a lock, search the list, and the release the lock before we
    finish using the values of the list. While unlikely, the string could be
    deleted in the meanwhile.
---
 src/lib/eina/eina_tmpstr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_tmpstr.c b/src/lib/eina/eina_tmpstr.c
index 7181b75..a49279b 100644
--- a/src/lib/eina/eina_tmpstr.c
+++ b/src/lib/eina/eina_tmpstr.c
@@ -133,8 +133,9 @@ eina_tmpstr_len(Eina_Tmpstr *tmpstr)
      {
         if (s->str == tmpstr)
          {
+             size_t ret = s->length;
              eina_lock_release(&_mutex);
-             return s->length;
+             return ret;
          }
      }
    eina_lock_release(&_mutex);

-- 


Reply via email to