From 80aae072ef6201d19df402d8e4b93a3333c83c42 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 8 Feb 2011 14:11:47 +0000 Subject: [PATCH] * edje: fix invalid memory access by edje alias code. Reported by Jonathan Atton "Watchwolf". SVN revision: 56810 --- legacy/edje/ChangeLog | 4 ++++ legacy/edje/src/lib/edje_util.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index eb53e116df..096c34d5a8 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -12,3 +12,7 @@ 2011-02-01 Tom Hacohen (TAsn) * Added Mirroring support to edje objects. + +2011-02-08 Cedric BAIL + + * Fix invalid memory access by edje alias code. diff --git a/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c index 819085f1a5..2cadbc8e43 100644 --- a/legacy/edje/src/lib/edje_util.c +++ b/legacy/edje/src/lib/edje_util.c @@ -4514,8 +4514,14 @@ _edje_real_part_recursive_get_helper(const Edje *ed, char **path) const char *alias = NULL; char *idx = NULL; + if (!path[0]) + return NULL; + if (ed->collection && ed->collection->alias) - alias = eina_hash_find(ed->collection->alias, path[0]); + { + alias = eina_hash_find(ed->collection->alias, path[0]); + if (alias) alias = strdupa(alias); + } if (!alias) alias = path[0];