From: Jürg Billeter Date: Sun, 2 Aug 2009 19:31:40 +0000 (+0200) Subject: D-Bus: Fix crash when using unsupported types in dynamic clients X-Git-Tag: 0.7.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a334ceda26f50257fad73e31eb083c0edf84e0c2;p=thirdparty%2Fvala.git D-Bus: Fix crash when using unsupported types in dynamic clients Fixes bug 586479. --- diff --git a/codegen/valadbusclientmodule.vala b/codegen/valadbusclientmodule.vala index 9dfcaae01..fad0eaf88 100644 --- a/codegen/valadbusclientmodule.vala +++ b/codegen/valadbusclientmodule.vala @@ -544,6 +544,11 @@ internal class Vala.DBusClientModule : DBusModule { string getter_cname = "_dynamic_get_%s%d".printf (prop.name, dynamic_property_id++); + if (get_type_signature (prop.property_type) == null) { + Report.error (prop.property_type.source_reference, "D-Bus serialization of type `%s' is not supported".printf (prop.property_type.to_string ())); + return getter_cname; + } + var func = new CCodeFunction (getter_cname, prop.property_type.get_cname ()); func.modifiers |= CCodeModifiers.STATIC | CCodeModifiers.INLINE; @@ -568,6 +573,11 @@ internal class Vala.DBusClientModule : DBusModule { string setter_cname = "_dynamic_set_%s%d".printf (prop.name, dynamic_property_id++); + if (get_type_signature (prop.property_type) == null) { + Report.error (prop.property_type.source_reference, "D-Bus serialization of type `%s' is not supported".printf (prop.property_type.to_string ())); + return setter_cname; + } + var func = new CCodeFunction (setter_cname, "void"); func.modifiers |= CCodeModifiers.STATIC | CCodeModifiers.INLINE;