diff options
author | Benjamin Berg <bberg@redhat.com> | 2019-03-20 14:31:57 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2019-03-20 17:26:56 +0100 |
commit | ae22f72cac973199902e7196b7f3f69e100e4b50 (patch) | |
tree | 44a7bfdbb46d5d3ad5eff4255f566a382c99933d /panels/display | |
parent | 0c4e84e41708c52d33abe4abee8c451726088010 (diff) | |
download | gnome-control-center-ae22f72cac973199902e7196b7f3f69e100e4b50.tar.gz |
display: Prevent error when serializing invalid configuration
If no monitors are enabled, then the variant would end up with an
invalid variant type, causing a crash later on. This case only happened
due to other bugs (i.e. in principle we should never send a
configuration without any monitors to the server).
Prevent the serialization error by specifying the correct type for the
builder, therefore potentially preventing a crash in such a corner case.
Diffstat (limited to 'panels/display')
-rw-r--r-- | panels/display/cc-display-config-dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c index 2ef166de6..2615461ea 100644 --- a/panels/display/cc-display-config-dbus.c +++ b/panels/display/cc-display-config-dbus.c @@ -951,7 +951,7 @@ build_logical_monitors_parameter (CcDisplayConfigDBus *self) GHashTableIter iter; CcDisplayLogicalMonitor *logical_monitor; - g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(iiduba(ssa{sv}))")); g_hash_table_iter_init (&iter, self->logical_monitors); while (g_hash_table_iter_next (&iter, (void **) &logical_monitor, NULL)) |