mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
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:
committed by
Maxime Ripard
parent
e2b5f1da5f
commit
80f48b7d77
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user