Commit c57ddfae authored by Dan Carpenter's avatar Dan Carpenter Committed by Marcel Holtmann

Bluetooth: btusb: off by one in rtl8723b_parse_firmware()

The ">" should be ">=" so that we don't read past the end of the array.

Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDaniel Drake <drake@endlessm.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent eb50042f
...@@ -1502,7 +1502,7 @@ static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver, ...@@ -1502,7 +1502,7 @@ static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver,
return -EINVAL; return -EINVAL;
} }
if (project_id > ARRAY_SIZE(project_id_to_lmp_subver)) { if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) {
BT_ERR("%s: unknown project id %d", hdev->name, project_id); BT_ERR("%s: unknown project id %d", hdev->name, project_id);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment