From af9b5f2f8553b62d9bc7b212ca7f1246268e6620 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 12 Apr 2018 14:39:45 -0700 Subject: [PATCH] ecore: efl_model_list_value_get will throw error when asked for out of range value. --- src/lib/ecore/ecore_internal.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_internal.h b/src/lib/ecore/ecore_internal.h index c585f40aa4..8a54487aba 100644 --- a/src/lib/ecore/ecore_internal.h +++ b/src/lib/ecore/ecore_internal.h @@ -40,7 +40,10 @@ efl_model_list_value_get(Eina_List *childrens, Eina_List *l; Eo *child; - eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, eina_list_count(childrens)); + if (eina_list_count(childrens) < start + count) + return eina_value_error_init(EFL_MODEL_ERROR_INCORRECT_VALUE); + + eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, 4); childrens = eina_list_nth_list(childrens, start);