From patchwork Wed May 25 02:32:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: XueBing Chen X-Patchwork-Id: 12860682 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BC5E4C433EF for ; Wed, 25 May 2022 02:39:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:MIME-Version:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=i2HLxk3VmAIM7mb8xsTBPbOABEVbjV7A8IA0I7hpqHE=; b=x6CgqI3AK+taCP DHMfQCsT5vjUGxx9DWl+LyGIybUqSH18oaxU4llKHFoFEmIw9v9s4eTNEyeLDIiHtw8XaDg9a5x/m HIwcn/I2wJv+qLH/Nt4iKRbIgCIr23FV6O3PZTePXSZU2GxFXM2jJJOG2OsXjrh9UriMUN9LnrjCU u4xGhf4YbtaQQxMQP6s1Tjeyf36I7Igotbe2yK6bURZcU+T6RPciV4PoZxY6iI0K/2KWQvxbOnWmn JF+1XKoIvh6kBBraoKUR8VrtxrN6yHVe484GW/JlpTo+C25VC9BKBGZwAVF4XFoETjrNQU+KJkLzZ oBNlDIa2XZFUE4VpvfVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntguR-009lcd-L8; Wed, 25 May 2022 02:38:03 +0000 Received: from [218.92.28.120] (helo=jari.cn) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntguN-009lc0-4N for linux-arm-kernel@lists.infradead.org; Wed, 25 May 2022 02:38:01 +0000 Received: by ajax-webmail-localhost.localdomain (Coremail) ; Wed, 25 May 2022 10:32:46 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.40] Date: Wed, 25 May 2022 10:32:46 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "XueBing Chen" To: krzk@kernel.org Cc: alim.akhtar@samsung.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2] ARM: s3c: Use strscpy to replace strlcpy X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <3e0217ca.a1d.180f90f39c7.Coremail.chenxuebing@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwAXIW9OlY1iEuU3AA--.626W X-CM-SenderInfo: hfkh05pxhex0nj6mt2flof0/1tbiAQAOCmFEYxsksAAIsE X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220524_193800_349217_16C78C35 X-CRM114-Status: UNSURE ( 7.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The strlcpy should not be used because it doesn't limit the source length. Preferred is strscpy. Signed-off-by: XueBing Chen --- arch/arm/mach-s3c/mach-mini2440.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-s3c/mach-mini2440.c b/arch/arm/mach-s3c/mach-mini2440.c index 551ec660ab59..98cebc06521c 100644 --- a/arch/arm/mach-s3c/mach-mini2440.c +++ b/arch/arm/mach-s3c/mach-mini2440.c @@ -624,7 +624,7 @@ static char mini2440_features_str[12] __initdata = "0tb"; static int __init mini2440_features_setup(char *str) { if (str) - strlcpy(mini2440_features_str, str, + strscpy(mini2440_features_str, str, sizeof(mini2440_features_str)); return 1; }