Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3127759rwb; Fri, 2 Dec 2022 22:47:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Us1ghH7uRJoFRczkfeb8/Tn+8/ciRmdiDhJEr6ysdY+jAgzsj1eqeo6kVGXIpXJhWDTOZ X-Received: by 2002:a17:90a:eac2:b0:219:484:e955 with SMTP id ev2-20020a17090aeac200b002190484e955mr42807651pjb.214.1670050031292; Fri, 02 Dec 2022 22:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670050031; cv=none; d=google.com; s=arc-20160816; b=kODzZKLqJ7AgN5yQBLQnUzp5164AGOP3+qeCiAGZc0NewYmjAqHEVqEWg1Q7j50SKM e0rBIppn+WG6mpRzbiOA00ApTl4rwuJSI1/i31fALtzjD47J6VYS3ar2PDE2MFM9Hlc0 VBAbyNGeTakALckBDcMPEScOd/kMt7fRFqz3L7O9Ai///ih/I/1/GXvDq6ZpaXg6phR/ t5gsGmN2mUBpuew/3t+ODMPZdewJQnThW1cvnabu6JIsf/IdwfzGOhdz5SusAu0p0PZG KKKkzpd7TpVKkGa603L0020g+Y8Cgpx3Kbwi5w78DVNwYMJ6fF5Sglo9DZXwT2tYQj0D wYQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=Pezws09GILl9nPXb/eN2+UV5Eq5ppSGHSfn93GvANIQ=; b=hjexoku+EzV7XqeaqcrWizJHChgINXpwWsFncPU++BgwRPS71e20f/12eEQe2Iojlc wU0sTf3OFaIxPYCa2xPPGZ3KDdAjKBrMro+kgMTj3lu73jlChv4qRJAFek2fc5Bmwrr8 aK739xcOdbWy9yI9MI06pvrqCgd52+ZX0P7X8tG7YsWRFiGhZjeQ0WG5eL5Cjoy38onL ehwKKKY7ZjAr5ggZC3gJkQAxJKeTMGC0JZnSHJg6W3W3tGRYPvPM89O1i/hmotI49zwQ EvyemAIlX36a5JB5zn1z6SyFLZa1w2EIUd92ub0XV3KAWSpQ0KAEDom+h5oTKZyUMMKt T7eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iy3-20020a170903130300b001869ba21491si8543063plb.8.2022.12.02.22.46.51; Fri, 02 Dec 2022 22:47:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbiLCGLK (ORCPT + 83 others); Sat, 3 Dec 2022 01:11:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiLCGLI (ORCPT ); Sat, 3 Dec 2022 01:11:08 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149A9BEE1C for ; Fri, 2 Dec 2022 22:11:02 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NPKF10MTrz4y0v7; Sat, 3 Dec 2022 14:11:01 +0800 (CST) Received: from szxlzmapp07.zte.com.cn ([10.5.230.251]) by mse-fl1.zte.com.cn with SMTP id 2B36As15085164; Sat, 3 Dec 2022 14:10:54 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Sat, 3 Dec 2022 14:10:56 +0800 (CST) Date: Sat, 3 Dec 2022 14:10:56 +0800 (CST) X-Zmail-TransId: 2b04638ae870232ee8c4 X-Mailer: Zmail v1.0 Message-ID: <202212031410566533649@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIG02OGs6IHVzZSBzdHJzY3B5KCkgdG8gaW5zdGVhZCBvZiBzdHJuY3B5KCk=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2B36As15085164 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 638AE875.000 by FangMail milter! X-FangMail-Envelope: 1670047861/4NPKF10MTrz4y0v7/638AE875.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638AE875.000/4NPKF10MTrz4y0v7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Panda The implementation of strscpy() is more robust and safer. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- arch/m68k/kernel/setup_no.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c index cb6def585851..37fb663559b4 100644 --- a/arch/m68k/kernel/setup_no.c +++ b/arch/m68k/kernel/setup_no.c @@ -90,8 +90,7 @@ void __init setup_arch(char **cmdline_p) config_BSP(&command_line[0], sizeof(command_line)); #if defined(CONFIG_BOOTPARAM) - strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); - command_line[sizeof(command_line) - 1] = 0; + strscpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); #endif /* CONFIG_BOOTPARAM */ process_uboot_commandline(&command_line[0], sizeof(command_line)); -- 2.15.2