From: cedric Date: Fri, 2 Jul 2010 15:37:37 +0000 (+0000) Subject: * edje: prevent some segv in edje_cc and detect wrong edje file X-Git-Tag: submit/2.0alpha-wayland/20121127.221958~1237 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d981b9ff76ba9e43d1df319d73233bc2df8c137d;p=profile%2Fivi%2Fedje.git * edje: prevent some segv in edje_cc and detect wrong edje file before compiling them. Patch by Rafael Fonseca . git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@49999 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index 438cf37..67e92cf 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -1586,7 +1586,7 @@ st_styles_style_name(void) stl->name = parse_str(0); EINA_LIST_FOREACH(edje_file->styles, l, tstl) { - if ((stl != tstl) && (!strcmp(stl->name, tstl->name))) + if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name))) { ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"", progname, file_in, line - 1, stl->name); diff --git a/src/bin/edje_cc_parse.c b/src/bin/edje_cc_parse.c index 24196cf..7c53ffd 100644 --- a/src/bin/edje_cc_parse.c +++ b/src/bin/edje_cc_parse.c @@ -644,6 +644,8 @@ compile(void) int fd; off_t size; char *data, *p; + Eina_List *l; + Edje_Style *stl; if (!tmp_dir) #ifdef HAVE_EVIL @@ -807,6 +809,13 @@ compile(void) } free(data); close(fd); + + EINA_LIST_FOREACH(edje_file->styles, l, stl) + if (!stl->name) + { + ERR("%s: Error. style must have a name.", progname); + exit(-1); + } } int