From: bdilly Date: Mon, 20 Jun 2011 21:59:31 +0000 (+0000) Subject: Edje: fix invalid read on edje embryo get_part_id X-Git-Tag: submit/trunk/20120815.180907~598 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cb47324ff2a336500319bead7a5ef9a14106658;p=profile%2Fivi%2Fedje.git 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 --- 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;