rtk_btusb: Fix potential buffer overflow in cfg_list_item struct

The `cfg_list_item` struct previously defined the `data` array with a zero-length,
which can lead to buffer overflow issues detected by the `fortify_memcpy_chk` function.
So change the zero-length array to a flexible array length.

Bug 4915378

Change-Id: I3420406e73a9eec892665380bb15d680df12e751
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3237079
(cherry picked from commit 9c30467627)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233101
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
This commit is contained in:
Shobek Attupurath
2024-10-18 17:59:14 +00:00
committed by Jon Hunter
parent 1f6ba48285
commit 76aa342b73

View File

@@ -69,7 +69,7 @@ struct cfg_list_item {
struct list_head list;
u16 offset;
u8 len;
u8 data[0];
u8 data[];
};
static struct list_head list_configs;