tester: bluetooth: gatt: fix null pointer case CASE failed
GATT/SR/GAD/BV-03-C will read attr value, but we parse NULL from `attr->read` which point to `attr_read` function. Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit is contained in:
parent
1df0569001
commit
ce40fa434f
1 changed files with 1 additions and 1 deletions
|
@ -304,7 +304,7 @@ static ssize_t read_value(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
||||||
return BT_GATT_ERR(BT_ATT_ERR_AUTHORIZATION);
|
return BT_GATT_ERR(BT_ATT_ERR_AUTHORIZATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((attr->perm & GATT_PERM_ENC_READ_MASK) &&
|
if ((attr->perm & GATT_PERM_ENC_READ_MASK) && (conn != NULL) &&
|
||||||
(value->enc_key_size > bt_conn_enc_key_size(conn))) {
|
(value->enc_key_size > bt_conn_enc_key_size(conn))) {
|
||||||
return BT_GATT_ERR(BT_ATT_ERR_ENCRYPTION_KEY_SIZE);
|
return BT_GATT_ERR(BT_ATT_ERR_ENCRYPTION_KEY_SIZE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue