GSettings: be more careful about keys names with /

Prevent attempts to access keys ending with slashes that exist in the
schema file as references to child schemas.

Also: don't emit change signals for these same keys.
This commit is contained in:
Ryan Lortie
2012-07-06 13:43:17 -04:00
parent 52a6d7022a
commit ed492a5de2
2 changed files with 17 additions and 5 deletions

View File

@@ -636,7 +636,7 @@ g_settings_schema_get_value (GSettingsSchema *schema,
value = gvdb_table_get_raw_value (schema->table, key);
if G_UNLIKELY (value == NULL)
if G_UNLIKELY (value == NULL || !g_variant_is_of_type (value, G_VARIANT_TYPE_TUPLE))
g_error ("Settings schema '%s' does not contain a key named '%s'", schema->id, key);
iter = g_variant_iter_new (value);