mesa/src/broadcom/simulator
Juan A. Suarez Romero 2d91798561 broadcom/simulator: use string copy instead of memcpy
Using memcpy with the max size generates a global-buffer-overflow, as
the performance counter strings are smaller than the max size.

Instead, use a string copy function to get a copy.

This was detected with address sanitizer enabled and running vulkaninfo.

Fixes: 3e8b2fe053 ("broadcom/simulator: Add DRM_IOCTL_V3D_GET_COUNTER to simulator")
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33627>
2025-02-20 13:15:01 +00:00
..
meson.build broadcom: do not include simulator if not available 2024-09-26 06:12:23 +00:00
v3d_simulator.c broadcom: do not include simulator if not available 2024-09-26 06:12:23 +00:00
v3d_simulator.h broadcom: only support v42 and v71 2023-11-02 11:59:08 +01:00
v3d_simulator_wrapper.cpp broadcom: do not include simulator if not available 2024-09-26 06:12:23 +00:00
v3d_simulator_wrapper.h v3d,v3d: use new simulator 2024-03-11 10:23:48 +00:00
v3dx_simulator.c broadcom/simulator: use string copy instead of memcpy 2025-02-20 13:15:01 +00:00
v3dx_simulator.h broadcom/simulator: Add DRM_IOCTL_V3D_GET_COUNTER to simulator 2024-05-22 05:37:48 +00:00