diff options
author | Havoc Pennington <hp@pobox.com> | 2000-01-15 04:53:18 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-01-15 04:53:18 +0000 |
commit | a790d696ad7b16ca745d1d555888ecaa727997e0 (patch) | |
tree | 27d95b96233b7ed9dbe8682656c88cd91f384230 /gconf/gconf-internals.c | |
parent | c467313a37c2feabb1b8018e2184ddc4b732984d (diff) | |
download | gconf-a790d696ad7b16ca745d1d555888ecaa727997e0.tar.gz |
remove bad assertion that the value in an entry was non-NULL
2000-01-14 Havoc Pennington <hp@pobox.com>
* gconf/gconfd.c (gconfd_all_entries): remove bad assertion that
the value in an entry was non-NULL
* gconf/gconf.c (gconf_set): check for invalid list type
* gconf/gconf-internals.c
(gconf_value_from_corba_value): Be more
paranoid about list types coming from gconfd
Diffstat (limited to 'gconf/gconf-internals.c')
-rw-r--r-- | gconf/gconf-internals.c | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index 613b24bc..90571c29 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -245,31 +245,38 @@ gconf_value_from_corba_value(const ConfigValue* value) break; } - i = 0; - while (i < value->_u.list_value.seq._length) + if (gconf_value_list_type(gval) != GCONF_VALUE_INVALID) { - GConfValue* val; - - /* This is a bit dubious; we cast a ConfigBasicValue to ConfigValue - because they have the same initial members, but by the time - the CORBA and C specs kick in, not sure we are guaranteed - to be able to do this. - */ - val = gconf_value_from_corba_value((ConfigValue*)&value->_u.list_value.seq._buffer[i]); - - if (val == NULL) - gconf_log(GCL_ERR, _("Couldn't interpret CORBA value for list element")); - else if (val->type != gconf_value_list_type(gval)) - gconf_log(GCL_ERR, _("Incorrect type for list element in %s"), __FUNCTION__); - else - list = g_slist_prepend(list, val); - - ++i; - } + i = 0; + while (i < value->_u.list_value.seq._length) + { + GConfValue* val; + + /* This is a bit dubious; we cast a ConfigBasicValue to ConfigValue + because they have the same initial members, but by the time + the CORBA and C specs kick in, not sure we are guaranteed + to be able to do this. + */ + val = gconf_value_from_corba_value((ConfigValue*)&value->_u.list_value.seq._buffer[i]); + + if (val == NULL) + gconf_log(GCL_ERR, _("Couldn't interpret CORBA value for list element")); + else if (val->type != gconf_value_list_type(gval)) + gconf_log(GCL_ERR, _("Incorrect type for list element in %s"), __FUNCTION__); + else + list = g_slist_prepend(list, val); + + ++i; + } - list = g_slist_reverse(list); + list = g_slist_reverse(list); - gconf_value_set_list_nocopy(gval, list); + gconf_value_set_list_nocopy(gval, list); + } + else + { + gconf_log(GCL_ERR, _("Received list from gconfd with a bad list type")); + } } break; case GCONF_VALUE_PAIR: @@ -365,7 +372,7 @@ fill_corba_value_from_gconf_value(GConfValue* value, default: cv->_u.list_value.list_type = BInvalidVal; - g_warning("Invalid list type in %s", __FUNCTION__); + gconf_log(GCL_DEBUG, "Invalid list type in %s", __FUNCTION__); break; } |