drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test

Replace the use of strcpy to strscpy on the test_to_desc of the
drm_test_framebuffer_create test for better security and reliability.

Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-4-gcarlos@disroot.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Carlos Eduardo Gallo Filho
2024-09-10 21:15:28 -03:00
committed by Maxime Ripard
parent e2b5f1da5f
commit 80f48b7d77

View File

@@ -409,7 +409,7 @@ static void drm_test_framebuffer_create(struct kunit *test)
static void drm_framebuffer_test_to_desc(const struct drm_framebuffer_test *t, char *desc)
{
strcpy(desc, t->name);
strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
}
KUNIT_ARRAY_PARAM(drm_framebuffer_create, drm_framebuffer_create_cases,