bt: realtek: 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 4701669

Change-Id: I3c4575efbab681fa8b6039793c410b23c4179106
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3159595
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2024-06-19 09:28:50 +00:00
committed by mobile promotions
parent 00e9f705d4
commit 6f80c397ed

View File

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