Commit 36fb0279 authored by Nazar Palamar's avatar Nazar Palamar Committed by Anas Nashif
Browse files

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: default avatarNazar Palamar <nazar.palamar@infineon.com>
parent 492439af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static struct ccc_value ccc_values[MAX_CCC_COUNT];
static int ccc_find_by_attr(uint16_t handle)
{
	for (int i = 0; i < MAX_CCC_COUNT; i++) {
		if (handle == ccc_values[i].attr->handle) {
		if ((ccc_values[i].attr != NULL) && (handle == ccc_values[i].attr->handle)) {
			return i;
		}
	}