From: Carlos Eduardo Gallo Filho Date: Wed, 11 Sep 2024 00:15:28 +0000 (-0300) Subject: drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test X-Git-Tag: v6.13-rc1~122^2~23^2~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80f48b7d77fc82b5f7b7f4ab14b4bbcb618c5e53;p=thirdparty%2Fkernel%2Flinux.git 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 Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-4-gcarlos@disroot.org Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c index 3ed9874233226..4b1884be9d7a2 100644 --- a/drivers/gpu/drm/tests/drm_framebuffer_test.c +++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c @@ -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,