From patchwork Tue Oct 24 19:09:54 2023 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: 13435194 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 C23FFC25B6B for ; Tue, 24 Oct 2023 19:10:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10E7B10E47D; Tue, 24 Oct 2023 19:10:33 +0000 (UTC) Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D50D10E47D for ; Tue, 24 Oct 2023 19:10:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id EF2D4408F8; Tue, 24 Oct 2023 21:10:29 +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 b20wkq-0792A; Tue, 24 Oct 2023 21:10:29 +0200 (CEST) From: Carlos Eduardo Gallo Filho DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1698174629; bh=xG41h1/DHO5ER3lxWs270Udv8i/mW1twDfbQMTeqiNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PACCjmOAwbBwO1o2jHU80iT4hCvYQi3n1ZBT8K7Z9piCzMgHL2h7vbwyn0d1+/6rm YRNGkYq5fe1IfEypIZZ44D4GxSIAPhfQI7e6u37KZabv2QKQRlXaeYwxAuYpNV/sFS eMwzRG654pKI4/7ydpHumeVCsMPh0W29bCkErJJLr73OwRfzRGUng84uQ2xAOFhAon rfBS9FAsQTDuRB0ZJqgEiEwC9QX5wgj+ymtl7jB5JbhkZh3yc6jtcK4EhWEHDmFZ2t q32CmADfHRd8ptrNJiiirBqIuJ6vZ7iOQP79TAm6BKXt4V2yxkcAidVy2XfZSfwYWy rQdy/8L/J9AuA== To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 03/11] drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test Date: Tue, 24 Oct 2023 16:09:54 -0300 Message-ID: <20231024191002.1620-4-gcarlos@disroot.org> In-Reply-To: <20231024191002.1620-1-gcarlos@disroot.org> References: <20231024191002.1620-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: , Cc: =?utf-8?q?Andr=C3=A9_Almeida?= , Thomas Zimmermann , Carlos Eduardo Gallo Filho , Maxime Ripard , =?utf-8?q?Ma=C3=ADra_Canal?= , Tales Lelo da Aparecida , Arthur Grillo 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 659cbd5a3be3..eb76a71644e9 100644 --- a/drivers/gpu/drm/tests/drm_framebuffer_test.c +++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c @@ -397,7 +397,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,