This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 26aa1d477db61529a135ee0140e42f6cbb2b618c
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 8 17:25:06 2026 -0600
eldbus: the model lists its property from a static array
Eldbus.Model.properties built its iterator over a char array on the
function's stack, which the iterator reads after the function returned.
Walking the properties of a connection model crashed. Use a static
array. Efl.Ui.Size_Model has the same bug, fixed separately.
The other EINA_C_ARRAY_ITERATOR_NEW uses over a local array
(Collection_View, Layout, Caching_Factory) hand it to
Efl.Ui.Factory.create/release, which consume and free it before they
return, so they are left as they are.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/eldbus/eldbus_model.c | 3 ++-
src/tests/eldbus/eldbus_test_eldbus_model_connection.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lib/eldbus/eldbus_model.c b/src/lib/eldbus/eldbus_model.c
index ee86ff54a5..3e67a7367e 100644
--- a/src/lib/eldbus/eldbus_model.c
+++ b/src/lib/eldbus/eldbus_model.c
@@ -161,7 +161,8 @@ static Eina_Iterator *
_eldbus_model_efl_model_properties_get(const Eo *obj EINA_UNUSED,
Eldbus_Model_Data *pd EINA_UNUSED)
{
- char *unique[] = { UNIQUE_NAME_PROPERTY };
+ // The iterator reads it after this returns.
+ static const char *unique[] = { UNIQUE_NAME_PROPERTY };
return EINA_C_ARRAY_ITERATOR_NEW(unique);
}
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
index 4e57c75d43..60b4f627c8 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
@@ -37,8 +37,12 @@ EFL_START_TEST(properties_get)
unsigned int actual_properties_count = 0;
const char *prop;
+ // The names are read after the call returned: they must not be on its stack.
EINA_ITERATOR_FOREACH(properties, prop)
- actual_properties_count++;
+ {
+ ck_assert_str_eq(prop, UNIQUE_NAME_PROPERTY);
+ actual_properties_count++;
+ }
eina_iterator_free(properties);
ck_assert_int_eq(expected_properties_count, actual_properties_count);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.