Thread (18 messages) flat view 18 messages, 2 authors, 2012-02-21

Re: [PATCH obexd 3/9] client: deny cancel when no agent present

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-02-21 11:12:28

Hi Mikel,

On Tue, Feb 21, 2012 at 10:46 AM, Mikel Astiz [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Mikel Astiz <redacted>

The authorization check should consider the scenario of no agent being
assigned to the transfer.
---
 client/transfer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/client/transfer.c b/client/transfer.c
index 157811d..4054799 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -168,7 +168,7 @@ static DBusMessage *obc_transfer_cancel(DBusConnection *connection,
       DBusMessage *reply;

       sender = dbus_message_get_sender(message);
-       if (g_str_equal(transfer->agent, sender) == FALSE)
+       if (g_strcmp0(transfer->agent, sender) != 0)
               return g_dbus_create_error(message,
                               "org.openobex.Error.NotAuthorized",
                               "Not Authorized");
--
1.7.6.5
This is actually a fix, g_str_equal does not do NULL-safe comparisons,
could you please make this clear in your commit message.

-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help