GNOME Bugzilla – Bug 688232
Handle array types in pygi_get/set_property_value_real
Last modified: 2018-01-10 20:20:27 UTC
It looks as though gi/pygi-property.c:pygi_set_property_value_real assumes GI_TYPE_TAG_ARRAY properties are always GStrv. The function seems generic enough that it should not be making this assumption. There is also only one array property type being tested in tests/test_gi.py which makes use of: GIMarshallingTests.PropertiesObject.props.some_strv so we need to add more array type properties to the marshaling tests as well.
The following fix has been pushed: 56e6285 Make sure g_value_set_boxed does not cause a buffer overrun with GStrvs A related fix which furthers the assumption that GI_TYPE_TAG_ARRAYs are always GStrvs, but at least fixes the buffer overrun involved.
Created attachment 228870 [details] [review] Make sure g_value_set_boxed does not cause a buffer overrun with GStrvs Add NULL terminator to gchar** passed to g_value_set_boxed to make sure it does not overrun memory in pygi_set_property_value_real. Add MALLOC_CHECK_=3 to "make check" which prints an error and aborts in these cases.
Yeah, trying to access a GPtrArray-valued property (which NM is using now) will end up causing a crash. FTR, note that gjs doesn't handle this either (although it just throws an error rather than crashing).
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/37.