gatt: Fix crash with BR/EDR only adapter
PATCH 1/1 gatt: Fix crash with BR/EDR only adapter
adapter->database can be NULL if controller is BR/EDR only or LE was disabled. Make btd_gatt_database_restore_svc_chng_ccc accept NULL pointer and silently ignore it similiar to rest of btd_gatt_database API.
--- src/gatt-database.c | 3 +++ 1 file changed, 3 insertions(+)
src/gatt-database.c +3 -0
@@ -3330,6 +3330,9 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database)uint8_t value[4 ];uint16_t handle, ccc_handle; +if (!database) +return ; + handle =gatt_db_attribute_get_handle (database->svc_chngd); ccc_handle =gatt_db_attribute_get_handle (database->svc_chngd_ccc);
Signature · 1 line
2.14.3
Szymon Janc
AppliedQuoted 23 lines · Szymon Janc
adapter->databasecan be NULL if controller is BR/EDR only or LE was disabled. Makebtd_gatt_database_restore_svc_chng_cccaccept NULL pointer and silently ignore it similiar to rest ofbtd_gatt_databaseAPI.--- src/gatt-database.c | 3 +++ 1 file changed, 3 insertions(+)src/gatt-database.c +3
-1@@ -3330,6 +3330,9 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database)uint8_t value[4 ];uint16_t handle, ccc_handle; +if (!database) +return ; + handle =gatt_db_attribute_get_handle (database->svc_chngd); ccc_handle =gatt_db_attribute_get_handle (database->svc_chngd_ccc); --
Quoted 2 lines
2.14.3
Applied.
Signature · 2 lines
pozdrawiam Szymon K. Janc