Hi Tim,
On 10/23/19 3:23 PM, Tim Kourt wrote:
---
client/agent.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/client/agent.c b/client/agent.c
index 5ed6538f..a64d71c5 100644
--- a/client/agent.c
+++ b/client/agent.c
@@ -112,7 +112,9 @@ static struct l_dbus_message *request_passphrase_method_call(
"'--"COMMAND_OPTION_PASSPHRASE"' "
"command-line option.\n");
- l_dbus_message_get_arguments(message, "o", &path);
+ if (!l_dbus_message_get_arguments(message, "o", &path))
+ return NULL;
+
This isn't actually correct. If the method call fails to parse, then
returning an error here just means that no reply is sent (and it will
time out in 30 seconds or so, depending on dbus policy). You probably
want to send an error instead.
Returning NULL is generally only used for asynchronous callbacks.
if (!path)
return NULL;
@@ -153,7 +155,9 @@ static struct l_dbus_message
*request_private_key_passphrase_method_call(
"'--"COMMAND_OPTION_PASSPHRASE"' "
"command-line option.\n");
- l_dbus_message_get_arguments(message, "o", &path);
+ if (!l_dbus_message_get_arguments(message, "o", &path))
+ return NULL;
+
if (!path)
return NULL;
@@ -216,7 +220,9 @@ static struct l_dbus_message
*request_username_and_password_method_call(
"'--"COMMAND_OPTION_PASSWORD"' "
"command-line option.\n");
- l_dbus_message_get_arguments(message, "o", &path);
+ if (!l_dbus_message_get_arguments(message, "o", &path))
+ return NULL;
+
if (!path)
return NULL;
@@ -275,7 +281,9 @@ static struct l_dbus_message *request_user_password_method_call(
"'--"COMMAND_OPTION_PASSWORD"' "
"command-line option.\n");
- l_dbus_message_get_arguments(message, "os", &path, &username);
+ if (!l_dbus_message_get_arguments(message, "os", &path, &username))
+ return NULL;
+
if (!path || !username)
return NULL;
Same for all of these.
Regards,
-Denis