From c85cb19c8fb303dc1a3ef5eb0c9eef70fbd8aac5 Mon Sep 17 00:00:00 2001 From: bdilly Date: Mon, 20 Jun 2011 21:59:31 +0000 Subject: [PATCH] Edje: fix invalid read on edje embryo get_part_id It was expecting for a null terminator. But that wasn't the case. Using parts_count instead. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@60537 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_embryo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/edje_embryo.c b/src/lib/edje_embryo.c index e0c5f7d..7575cca 100644 --- a/src/lib/edje_embryo.c +++ b/src/lib/edje_embryo.c @@ -807,6 +807,7 @@ _edje_embryo_fn_get_part_id(Embryo_Program *ep, Embryo_Cell *params) Edje_Part_Collection *col; Edje_Part **part; char *p; + unsigned int i; CHKPARAM(1); ed = embryo_program_data_get(ep); @@ -814,7 +815,8 @@ _edje_embryo_fn_get_part_id(Embryo_Program *ep, Embryo_Cell *params) if (!p) return -1; col = ed->collection; if (!col) return -1; - for (part = col->parts; *part; part++) + part = col->parts; + for (i = 0; i < col->parts_count; i++, part++) { if (!(*part)->name) continue; if (!strcmp((*part)->name, p)) return (*part)->id; -- 2.7.4