summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-01-25 11:24:54 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-01-25 11:27:02 -0500
commit200f45c2b5841133d3999c6b16c980be0d8a04f2 (patch)
tree196911ed674eeddc77a3d9a03c886eeb07131259 /src/lib/efreet
parent9aee7c249a8ef237dbc617474c0e45dea8a42475 (diff)
efreet: add locking for efreet_desktop_x_field_get()
in a threaded environment, reading from a hash is not atomic and is subject to race conditions @fix ref 39417cf0ea4e457fbc8d50d120bb8ac776aa366f
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_desktop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index f3cef0c98a..78d0f514cb 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -537,8 +537,10 @@ efreet_desktop_x_field_get(Efreet_Desktop *desktop, const char *key)
537 EINA_SAFETY_ON_NULL_RETURN_VAL(desktop->x, NULL); 537 EINA_SAFETY_ON_NULL_RETURN_VAL(desktop->x, NULL);
538 EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), NULL); 538 EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), NULL);
539 539
540 eina_lock_take(&_lock);
540 ret = eina_hash_find(desktop->x, key); 541 ret = eina_hash_find(desktop->x, key);
541 ret = eina_stringshare_add(ret); 542 ret = eina_stringshare_add(ret);
543 eina_lock_release(&_lock);
542 if (ret && (!ret[0])) 544 if (ret && (!ret[0]))
543 { 545 {
544 /* invalid null key somehow accepted; remove */ 546 /* invalid null key somehow accepted; remove */