3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-16 17:09:24 +01:00

ofono: Validate message parsing

This commit is contained in:
Tim Kourt 2019-10-23 13:24:03 -07:00 committed by Denis Kenzior
parent ea0fc68597
commit 1e0058cf73

View File

@ -624,7 +624,8 @@ static void interfaces_changed_cb(struct l_dbus_message *message,
struct l_dbus_message_iter value; struct l_dbus_message_iter value;
const char *key; const char *key;
l_dbus_message_get_arguments(message, "sv", &key, &value); if (!l_dbus_message_get_arguments(message, "sv", &key, &value))
return;
if (!strcmp(key, "Interfaces")) if (!strcmp(key, "Interfaces"))
parse_interfaces(&value, modem); parse_interfaces(&value, modem);
@ -718,10 +719,11 @@ static void get_modems_cb(struct l_dbus_message *reply, void *user_data)
modems = l_queue_new(); modems = l_queue_new();
l_dbus_message_get_arguments(reply, "a(oa{sv})", &modem_list); if (l_dbus_message_get_arguments(reply, "a(oa{sv})", &modem_list)) {
while (l_dbus_message_iter_next_entry(&modem_list, &path,
while (l_dbus_message_iter_next_entry(&modem_list, &path, &props)) &props))
parse_modem(path, &props); parse_modem(path, &props);
}
/* watch for modems being added/removed */ /* watch for modems being added/removed */
modem_add_watch = l_dbus_add_signal_watch(dbus_get_bus(), modem_add_watch = l_dbus_add_signal_watch(dbus_get_bus(),