From patchwork Wed Sep 11 00:15:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Eduardo Gallo Filho X-Patchwork-Id: 13799562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6E28EE01F1 for ; Wed, 11 Sep 2024 00:20:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F002210E8D7; Wed, 11 Sep 2024 00:20:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=disroot.org header.i=@disroot.org header.b="T69bQg1H"; dkim-atps=neutral Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3AFD110E933 for ; Wed, 11 Sep 2024 00:20:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 8E76241A11; Wed, 11 Sep 2024 02:13:06 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kL979mosPdis; Wed, 11 Sep 2024 02:13:05 +0200 (CEST) From: Carlos Eduardo Gallo Filho DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1726013585; bh=wlDPrqJloqXoPvzIW0o43ht0FObE1/bhLSwf/mqTox0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T69bQg1HnwK7E6xk7LKwMLiiY43g07vycFosxGqK7aY0HFDxAJa0wqotOLQLybjhK jeGHaver+MB4v7isXuq10BQc1/wuLQjKwhlBs3RKneHDYSIPbkfLNu8UxhB//eC9ZK p3aSHa7EYqTCKuZ6r50IPmkjYDaqtBITCmB0/98y5xC1COI8mM1HbHNu+VLE67NoQr rnbeuVjv4Qd1JOUTuCeCwv7z0TX1KFrUykToGY/E/CqT5bK0LpPr+QyoL2CGHU2fTG f/aOAvM7HzjN1l58FkqyY9q+1QTeZ2rMVign93snMz6oK7ccQaZ6zfhyn+dpz6AmjX bzOcPIOEfgdkw== To: dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , =?utf-8?q?Ma=C3=ADra_Canal?= , =?utf-8?q?Andr=C3=A9_?= =?utf-8?q?Almeida?= , Arthur Grillo , Tales Lelo da Aparecida , Carlos Eduardo Gallo Filho Subject: [PATCH v4 RESEND 3/9] drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test Date: Tue, 10 Sep 2024 21:15:28 -0300 Message-ID: <20240911001559.28284-4-gcarlos@disroot.org> In-Reply-To: <20240911001559.28284-1-gcarlos@disroot.org> References: <20240911001559.28284-1-gcarlos@disroot.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- drivers/gpu/drm/tests/drm_framebuffer_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c index 3ed987423322..4b1884be9d7a 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,