]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Fix crash when using unsupported types in dynamic clients
authorJürg Billeter <j@bitron.ch>
Sun, 2 Aug 2009 19:31:40 +0000 (21:31 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 2 Aug 2009 19:31:40 +0000 (21:31 +0200)
Fixes bug 586479.

codegen/valadbusclientmodule.vala

index 9dfcaae01f914d2481d0bf6aec69b397da78902b..fad0eaf88608deedb81cd226eaa7e65b1d363dc3 100644 (file)
@@ -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;