summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-10-06 17:09:40 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-10-06 17:09:40 +0200
commitb23b2074154582ef796b30879f36c82eeb077e0b (patch)
treee06bc569e962bd738c1018ded568db775c3e70d3
parent4e50b413d5237e3fcfa44780ab2207a871686bd2 (diff)
Don't allow NULL strings in dictionaries (just ignore them)
-rw-r--r--src/dbus-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 6c15dea2..5d04b481 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -300,6 +300,12 @@ void dbus_message_iter_append_dict_entry(DBusMessageIter *dict,
{
DBusMessageIter entry;
+ if (type == DBUS_TYPE_STRING) {
+ const char *str = *((const char **) val);
+ if (str == NULL)
+ return;
+ }
+
dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
NULL, &entry);