edje_cc: protect array lookup
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Sun, 9 Jun 2019 11:14:57 +0000 (13:14 +0200)
committerHosang Kim <hosang12.kim@samsung.com>
Wed, 12 Jun 2019 05:35:23 +0000 (14:35 +0900)
it seems with those two actions here in the commit, do use id in a
different way the other actions do. This is commit protects against
this.

Differential Revision: https://phab.enlightenment.org/D9078

src/bin/edje/edje_cc_out.c

index 168f7e6..7c91b9d 100644 (file)
@@ -735,6 +735,14 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
 
    EINA_LIST_FOREACH(ep->targets, l, et)
      {
+        /*
+         * we are accessing part with an id,
+         * if actions is ACTION_STOP or ACTION_TYPE_SCRIPT, then id is from the parts array.
+         * In order to not crash here, we should continue here.
+         */
+        if (ep->action != EDJE_ACTION_TYPE_ACTION_STOP || ep->action != EDJE_ACTION_TYPE_SCRIPT)
+          continue;
+
         if (et->id >= (int) pc->parts_count)
           {
              ERR("Target id '%d' greater than possible index '%d'.", et->id, (int) pc->parts_count - 1);