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
(cherry picked from commit 6f80c397ed)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166006
Tested-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2024-06-19 09:28:50 +00:00
committed by mobile promotions
parent df9e50c808
commit d99dede530

View File

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