All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH 8/8] ofono: Validate message parsing
Date: Wed, 23 Oct 2019 13:24:03 -0700	[thread overview]
Message-ID: <20191023202403.9690-8-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20191023202403.9690-1-tim.a.kourt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

---
 plugins/ofono.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 3120ea70..b13b3fb9 100644
--- 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(),
-- 
2.13.6

  parent reply	other threads:[~2019-10-23 20:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 20:23 [PATCH 1/8] client: Treat invalid DBus reply same as an error Tim Kourt
2019-10-23 20:23 ` [PATCH 2/8] client: Ignore invalid notifications Tim Kourt
2019-10-23 20:23 ` [PATCH 3/8] client: Ignore invalid agent requests Tim Kourt
2019-10-23 22:51   ` Denis Kenzior
2019-10-23 20:23 ` [PATCH 4/8] hotspot: Fix mem leak on failed hotspot config Tim Kourt
2019-10-23 22:56   ` Denis Kenzior
2019-10-23 20:24 ` [PATCH 5/8] hotspot Eliminate double assignment of variable Tim Kourt
2019-10-23 23:00   ` Denis Kenzior
2019-10-23 20:24 ` [PATCH 6/8] hwsim: Fix potential memory leak Tim Kourt
2019-10-23 20:24 ` [PATCH 7/8] client: Check family name before comparison Tim Kourt
2019-10-23 20:24 ` Tim Kourt [this message]
2019-10-23 22:50 ` [PATCH 1/8] client: Treat invalid DBus reply same as an error Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191023202403.9690-8-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.