Skip to content

Commit 36fb027

Browse files
npal-cynashif
authored andcommitted
test: bluetooth/tester: fix ccc_find_by_attr
Added check if ccc_values[i].attr != NULL, before accessing to ccc_values[i].attr structure: (handle == ccc_values[i].attr->handle) On 20829 platform it's causing hard fault, not sure about another platforms (in GAP testing). Signed-off-by: Nazar Palamar <[email protected]>
1 parent 492439a commit 36fb027

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/bluetooth/tester/src/btp_gatt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static struct ccc_value ccc_values[MAX_CCC_COUNT];
100100
static int ccc_find_by_attr(uint16_t handle)
101101
{
102102
for (int i = 0; i < MAX_CCC_COUNT; i++) {
103-
if (handle == ccc_values[i].attr->handle) {
103+
if ((ccc_values[i].attr != NULL) && (handle == ccc_values[i].attr->handle)) {
104104
return i;
105105
}
106106
}

0 commit comments

Comments
 (0)