GNOME Bugzilla – Bug 657481
Abstract properties' get() and set() functions aren't NULL-safe
Last modified: 2011-08-27 08:36:09 UTC
This code: public interface Folks.AliasDetails : Object { public abstract string alias { get; set; } } Ends up generating this C: const gchar* folks_alias_details_get_alias (FolksAliasDetails* self) { return FOLKS_ALIAS_DETAILS_GET_INTERFACE (self)->get_alias (self); } void folks_alias_details_set_alias (FolksAliasDetails* self, const gchar* value) { FOLKS_ALIAS_DETAILS_GET_INTERFACE (self)->set_alias (self, value); } ====== So, if client code blindly passes in NULL for self, it'll segfault. I think the generated code should include a g_return(_val)_if_fail() check like the class implementations to avoid this.
commit b10c156018783f7bd1c9f28a71297da7988a26b5 Author: Luca Bruno <lucabru@src.gnome.org> Date: Sat Aug 27 09:49:29 2011 +0200 codegen: Add type check in property vfunc Fixes bug 657481. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.