avoid undefined array access
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Jan 2011 03:11:00 +0000 (03:11 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Jan 2011 03:11:00 +0000 (03:11 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@56086 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_events.c

index f9773be..54fdcb2 100644 (file)
@@ -145,7 +145,7 @@ ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
      }
    if (ecore_raw_event_type == type)
      event_handlers_add_list = (Ecore_Event_Handler *)eina_inlist_append(EINA_INLIST_GET(event_handlers_add_list), EINA_INLIST_GET(eh));
-   else
+   else if (type < event_handlers_alloc_num)
      event_handlers[type] = (Ecore_Event_Handler *)eina_inlist_append(EINA_INLIST_GET(event_handlers[type]), EINA_INLIST_GET(eh));
    return eh;
 }