[PATCH BlueZ] adapter: Fix possible invalid memory access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---

This possible crash was detected by the clang static analysis tool.

 src/adapter.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 60477bb..36073ff 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1906,8 +1906,10 @@ static void create_stored_device_from_ltks(char *key, char *value,
 	bdaddr_t src;

 	info = get_ltk_info(key, value);
-	if (info)
-		keys->keys = g_slist_append(keys->keys, info);
+	if (info == NULL)
+		return;
+
+	keys->keys = g_slist_append(keys->keys, info);

 	if (g_slist_find_custom(adapter->devices, key,
 					(GCompareFunc) device_address_cmp))
--
1.7.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux