]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Fix get_all_properties() to handle NULL return from getter
authorJouni Malinen <j@w1.fi>
Fri, 1 Jan 2010 10:27:10 +0000 (12:27 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 1 Jan 2010 10:27:10 +0000 (12:27 +0200)
This needs to avoid trying to add the NULL entry into the D-Bus
message since libdbus will make the program terminate in such a case.

wpa_supplicant/dbus/dbus_new_helpers.c

index d3dbe53fec46627228a8573a6872554f783a6dd7..e4829f274f9cebea19d0bfc0885b5eef8111a0c2 100644 (file)
@@ -648,6 +648,8 @@ static DBusMessage * get_all_properties(
 
                        getterReply = property_dsc->getter(
                                message, obj_dsc->user_data);
+                       if (getterReply == NULL)
+                               goto skip;
                        dbus_message_iter_init(getterReply, &ret_iter);
 
                        dbus_message_iter_open_container(&dict_iter,
@@ -662,6 +664,7 @@ static DBusMessage * get_all_properties(
                        dbus_message_iter_close_container(&dict_iter,
                                                          &entry_iter);
                        dbus_message_unref(getterReply);
+               skip:
                        counter++;
                }
                property_dsc = property_dsc->next;