[PATCH 2/5] agent: Check that message exists before calling dbus

Jukka Rissanen jukka.rissanen at linux.intel.com
Thu Sep 5 06:17:50 PDT 2013


Dbus library will abort if dbus message reply is NULL so
check that before calling dbus API.
---
 src/agent-connman.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/agent-connman.c b/src/agent-connman.c
index 1169de9..664a5b3 100644
--- a/src/agent-connman.c
+++ b/src/agent-connman.c
@@ -74,6 +74,9 @@ static void request_input_passphrase_reply(DBusMessage *reply, void *user_data)
 	int name_len = 0;
 	DBusMessageIter iter, dict;
 
+	if (!reply)
+		goto done;
+
 	if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) {
 		error = dbus_message_get_error_name(reply);
 		goto done;
-- 
1.7.11.7




More information about the connman mailing list