commit 1e0058cf734f7811f71262cc7796a79423fb110f
parent ea0fc6859722cc579f496d8b07f7408f9feebf1f
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date: Wed, 23 Oct 2019 13:24:03 -0700
ofono: Validate message parsing
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
@@ -624,7 +624,8 @@ static void interfaces_changed_cb(struct l_dbus_message *message,
struct l_dbus_message_iter value;
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"))
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();
- l_dbus_message_get_arguments(reply, "a(oa{sv})", &modem_list);
-
- while (l_dbus_message_iter_next_entry(&modem_list, &path, &props))
- parse_modem(path, &props);
+ if (l_dbus_message_get_arguments(reply, "a(oa{sv})", &modem_list)) {
+ while (l_dbus_message_iter_next_entry(&modem_list, &path,
+ &props))
+ parse_modem(path, &props);
+ }
/* watch for modems being added/removed */
modem_add_watch = l_dbus_add_signal_watch(dbus_get_bus(),