summaryrefslogtreecommitdiff
path: root/profiles/network
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2015-04-09 14:14:18 +0200
committerSzymon Janc <szymon.janc@tieto.com>2015-04-09 14:28:28 +0200
commita8b1be8f829a1fc4a73c91d350615f3e416fdcec (patch)
tree1b662c2f91d826866f79a7675728ce1d2a6632a3 /profiles/network
parent546ec13c0df3ecbd60e66213f4aef49f8f39dfeb (diff)
downloadbluez-a8b1be8f829a1fc4a73c91d350615f3e416fdcec.tar.gz
profiles/network: Fix crash in network_property_get_uuid
Crash was due to invalid use of libdbus API. Invalid read of size 1 at 0x4A092F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x36A9A29DF3: ??? (in /usr/lib64/libdbus-1.so.3.7.12) by 0x36A9A17CC4: ??? (in /usr/lib64/libdbus-1.so.3.7.12) by 0x36A9A19EAD: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.12) by 0x42B9B6: network_property_get_uuid (connection.c:453) by 0x4847EE: append_property.isra.1 (object.c:510) by 0x4849EF: process_properties_from_interface (object.c:1688) by 0x484D23: process_changes (object.c:1719) by 0x36A7E492A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x36A7E49627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x36A7E49A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x40AF95: main (main.c:661) Address 0x3631313130303030 is not stack'd, malloc'd or (recently) free'd
Diffstat (limited to 'profiles/network')
-rw-r--r--profiles/network/connection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 77e0a3436..5305ace80 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -440,6 +440,7 @@ static gboolean network_property_get_uuid(const GDBusPropertyTable *property,
struct network_peer *peer = data;
struct network_conn *nc;
char uuid_str[MAX_LEN_UUID_STR];
+ const char *uuid = uuid_str;
bt_uuid_t uuid16, uuid128;
nc = find_connection_by_state(peer->connections, CONNECTED);
@@ -450,7 +451,7 @@ static gboolean network_property_get_uuid(const GDBusPropertyTable *property,
bt_uuid_to_uuid128(&uuid16, &uuid128);
bt_uuid_to_string(&uuid128, uuid_str, MAX_LEN_UUID_STR);
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid_str);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
return TRUE;
}