Bluetooth: Audio: add BIS index check for broadcast sink

When the broadcast sink receives a BASE it will now
properly check if the BIS indexes are valid.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-03-21 14:41:22 +01:00 committed by Carles Cufí
commit 9e765a2004

View file

@ -274,8 +274,8 @@ static bool net_buf_decode_bis_data(struct net_buf_simple *buf,
}
bis->index = net_buf_simple_pull_u8(buf);
if (bis->index == 0) {
BT_DBG("BIS index was 0");
if (!IN_RANGE(bis->index, BT_ISO_BIS_INDEX_MIN, BT_ISO_BIS_INDEX_MAX)) {
BT_DBG("Invalid BIS index %u", bis->index);
return false;
}