After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688232 - Handle array types in pygi_get/set_property_value_real
Handle array types in pygi_get/set_property_value_real
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 726999
Blocks:
 
 
Reported: 2012-11-13 10:52 UTC by Simon Feltman
Modified: 2018-01-10 20:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make sure g_value_set_boxed does not cause a buffer overrun with GStrvs (2.17 KB, patch)
2012-11-13 11:07 UTC, Simon Feltman
committed Details | Review

Description Simon Feltman 2012-11-13 10:52:30 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.
Comment 1 Simon Feltman 2012-11-13 11:07:34 UTC
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.
Comment 2 Simon Feltman 2012-11-13 11:07:35 UTC
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.
Comment 3 Dan Winship 2014-11-21 13:14:33 UTC
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).
Comment 4 GNOME Infrastructure Team 2018-01-10 20:20:27 UTC
-- 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.