Bluetooth: ATT: Fix write check permission
Writes to GATT attribute that has no write permission set, should return write not permitted (BT_ATT_ERR_WRITE_NOT_PERMITTED) in check permission routine. Change-Id: I95f0988e171294cd98b79d3e7b518383ac47567d Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
8b7097fd20
commit
348276044f
1 changed files with 1 additions and 1 deletions
|
@ -634,7 +634,7 @@ static uint8_t check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mask & BT_GATT_PERM_WRITE) && !(attr->perm & BT_GATT_PERM_WRITE)) {
|
if ((mask & BT_GATT_PERM_WRITE) && !(attr->perm & BT_GATT_PERM_WRITE)) {
|
||||||
return BT_ATT_ERR_READ_NOT_PERMITTED;
|
return BT_ATT_ERR_WRITE_NOT_PERMITTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
mask &= attr->perm;
|
mask &= attr->perm;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue