From 80e106f409675222d7a3dd2ad71e6ee7c16d3a88 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Fri, 10 Feb 2012 18:47:52 -0300 Subject: [PATCH] adapter: Fix possible invalid memory access --- src/adapter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 60477bb79..36073ff16 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)) -- 2.47.3