diff options
author | Jason-JH.Lin <[email protected]> | 2023-07-14 17:49:06 +0800 |
---|---|---|
committer | Chun-Kuang Hu <[email protected]> | 2023-08-10 23:47:49 +0000 |
commit | d761b9450e31e5abd212f0085d424ed32760de5a (patch) | |
tree | 7a4356714bc97fe112df1cc453463be58b8dd31f /lib/test_fortify/write_overflow-memcpy.c | |
parent | 27b9e2ea3f2757da26bb8280e46f7fdbb1acb219 (diff) |
drm/mediatek: Add cnt checking for coverity issue
CERT-C Characters and Strings (CERT STR31-C)
all_drm_priv[cnt] evaluates to an address that could be at negative
offset of an array.
In mtk_drm_get_all_drm_priv():
Guarantee that storage for strings has sufficient space for character
data and the null terminator.
So change cnt to unsigned int and check its max value.
Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Signed-off-by: Jason-JH.Lin <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: CK Hu <[email protected]>
Reviewed-by: Alexandre Mergnat <[email protected]>
Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/
Signed-off-by: Chun-Kuang Hu <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memcpy.c')
0 files changed, 0 insertions, 0 deletions