From c91f3a5a3edab4d1744ffcc514150e24d2b6672c Mon Sep 17 00:00:00 2001 From: Seungyoun Ju Date: Wed, 30 Nov 2016 14:30:12 +0900 Subject: [PATCH] Do not load a dev info if no technology has [Problem] Old storage could have invalid directory. It causes paired list corrupted [Cause & Measure] Old bluez has some issues to store CSRK. It makes invalid directory. It should be ignored when devices are loaded from storage. Change-Id: Ib18a4050f1d86145b2f53f8fff7629aebdff43ff Signed-off-by: Injun Yang --- src/adapter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 136a694..828f54f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -7593,7 +7593,7 @@ static uint8_t get_addr_type(GKeyFile *keyfile) techno = g_key_file_get_string_list(keyfile, "General", "SupportedTechnologies", NULL, NULL); if (!techno) - return BDADDR_BREDR; + return 0xff; for (t = techno; *t; t++) { if (g_str_equal(*t, "LE")) @@ -7713,6 +7713,10 @@ static void load_devices(struct btd_adapter *adapter) #ifdef TIZEN_FEATURE_BLUEZ_MODIFY str2ba(entry->d_name, &addr.bdaddr); addr.bdaddr_type = get_addr_type(key_file); + if (addr.bdaddr_type == 0xff) { + error("No SupportedTechnologies. Skipping"); + goto free; + } list = g_slist_find_custom(adapter->devices, &addr, device_addr_type_strict_cmp); -- 2.7.4