Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Dan Carpenter and committed by
Marcel Holtmann
c57ddfae eb50042f

+1 -1
+1 -1
drivers/bluetooth/btusb.c
··· 1502 1502 return -EINVAL; 1503 1503 } 1504 1504 1505 - if (project_id > ARRAY_SIZE(project_id_to_lmp_subver)) { 1505 + if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) { 1506 1506 BT_ERR("%s: unknown project id %d", hdev->name, project_id); 1507 1507 return -EINVAL; 1508 1508 }