diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-01-25 11:20:55 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-01-25 11:27:01 -0500 |
commit | 9aee7c249a8ef237dbc617474c0e45dea8a42475 (patch) | |
tree | c1f3e4f630993d10bfeae12dd68490567c6886b4 /src/lib/efreet | |
parent | 3d9a6e238af3837e273248c71da4d96daef10352 (diff) | |
download | efl-9aee7c249a8ef237dbc617474c0e45dea8a42475.tar.gz |
efreet: reject invalid "" data for Efreet_Desktop->x hash
ref T3096
@fix
Diffstat (limited to 'src/lib/efreet')
-rw-r--r-- | src/lib/efreet/efreet_desktop.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c index a49a975776..f3cef0c98a 100644 --- a/src/lib/efreet/efreet_desktop.c +++ b/src/lib/efreet/efreet_desktop.c @@ -515,6 +515,7 @@ efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char { EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(data && (!data[0]), EINA_FALSE); eina_lock_take(&_lock); if (!desktop->x) @@ -537,10 +538,15 @@ efreet_desktop_x_field_get(Efreet_Desktop *desktop, const char *key) EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), NULL); ret = eina_hash_find(desktop->x, key); - if (!ret) - return NULL; + ret = eina_stringshare_add(ret); + if (ret && (!ret[0])) + { + /* invalid null key somehow accepted; remove */ + efreet_desktop_x_field_del(desktop, key); + eina_stringshare_replace(&ret, NULL); + } - return eina_stringshare_add(ret); + return ret; } EAPI Eina_Bool |