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.


SVN revision: 60537
This commit is contained in:
Bruno Dilly 2011-06-20 21:59:31 +00:00
parent 702eb939d9
commit 56afa242b4
1 changed files with 3 additions and 1 deletions

View File

@ -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;