gatt-db: Check if permissions are set when adding CCC
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 21 Sep 2022 21:43:24 +0000 (14:43 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
CCC shall always have some permission set.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/gatt-db.c

index 9a7d64b..a749286 100644 (file)
@@ -1073,7 +1073,7 @@ gatt_db_service_add_ccc(struct gatt_db_attribute *attrib, uint32_t permissions)
        struct gatt_db_attribute *value;
        uint16_t handle = 0;
 
-       if (!attrib)
+       if (!attrib || !permissions)
                return NULL;
 
        db = attrib->service->db;