mesh: Fix reading device UUID from Join() call
authorInga Stotland <inga.stotland@intel.com>
Sat, 12 Jan 2019 02:40:54 +0000 (18:40 -0800)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 14:02:02 +0000 (19:32 +0530)
Supply correct parameters to l_dbus_message_iter_get_fixed_array
to get the location from where to read UUID value.

Change-Id: I0e2af0142882efb4d1079953a2a380dd9606dbdd
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/mesh.c

index 910623b..446ea29 100644 (file)
@@ -563,6 +563,7 @@ static struct l_dbus_message *join_network_call(struct l_dbus *dbus,
 {
        const char *app_path, *sender;
        struct l_dbus_message_iter iter_uuid;
+       uint8_t *uuid;
        uint32_t n;
 
        l_debug("Join network request");
@@ -577,7 +578,7 @@ static struct l_dbus_message *join_network_call(struct l_dbus *dbus,
 
        join_pending = l_new(struct join_data, 1);
 
-       l_dbus_message_iter_get_fixed_array(&iter_uuid, join_pending->uuid, &n);
+       l_dbus_message_iter_get_fixed_array(&iter_uuid, &uuid, &n);
 
        if (n != 16) {
                l_free(join_pending);
@@ -586,6 +587,8 @@ static struct l_dbus_message *join_network_call(struct l_dbus *dbus,
                                                        "Bad device UUID");
        }
 
+       memcpy(join_pending->uuid, uuid, 16);
+
        sender = l_dbus_message_get_sender(msg);
 
        join_pending->sender = l_strdup(sender);