Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5753400rwb; Mon, 5 Dec 2022 03:44:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6imnCoExDJ7KgMlRZVuhAtSW9+/wKAkv/jz0KB/bhT0d3aL2RJYUEqIlEKHwx5/Eb/HyiH X-Received: by 2002:a63:5a48:0:b0:478:5981:69e6 with SMTP id k8-20020a635a48000000b00478598169e6mr23614465pgm.398.1670240695676; Mon, 05 Dec 2022 03:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670240695; cv=none; d=google.com; s=arc-20160816; b=d2Zmf9ga08txgmz83feVKqUOCUoCFzbavPwEnI+2bRwnziot+l0OKjWS13NgWigbd7 tqp5CsuQrRYAqyBxl6zrhuc5ZAJA6+qTQ57fKxzXshPrJxiCM9PpodSf3SKHrlq1fbFt Dss6uptVlI+0hTO78GvtTomLIhXvexGbMRy8snxRHIKbblKLtKSeJ4Xda4O8RnwxrjW8 nZONaqvwu3qqrvm5ZXLuYMuAZbwoyWNWE4S0kxLapUk/A8V2mJe0uK07P490DNyU3yBG kvhurShIr6TUhkJe4uiFrFuhUZERkYrIUxLzWU5WlKd9Bf0HUQry2/UUnGaG/q4fo3is 8amw== 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=KbdE5n3rJKvlaMIaaYYftjEM97UMi+e35aYTMEvxXXg=; b=BBa8Hbu2DHmG8NPMBCUQUdgcgaZepKbOTeOgYb9DrzDvtZ+xCbNvA2l8iuZDkH5I+G 2KH/3JsQivTKzXSd/cmvRGNp9QRxCnQyyLBJpVq3SlsUu/QbViizp0OgiXCjKXyY81W9 DyIfz/JyO4AiD572VHtmCvyhLI+VugZLo+JeBWxCXXOSLjXkAwP9l3evEFsT+pbwOnT/ 3n07mgZSwy91WNcYe4HLg82bUnqtV5DTRMuwqS63YhqM4xIte7OEMtd1t1XeyR8P2vMf ELVeV43kLXjfIQgsLbC8rah9FE6aABOH9eD9bFMxMu97OAX0PwF10vIxByS1lFwoPTbt Fwtw== 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 d17-20020a170902ced100b001867d0e4307si15893746plg.372.2022.12.05.03.44.44; Mon, 05 Dec 2022 03:44:55 -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 S230459AbiLELac (ORCPT + 83 others); Mon, 5 Dec 2022 06:30:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbiLELaa (ORCPT ); Mon, 5 Dec 2022 06:30:30 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0FB10569; Mon, 5 Dec 2022 03:30:28 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NQhDf72jfz8R040; Mon, 5 Dec 2022 19:30:26 +0800 (CST) Received: from szxlzmapp02.zte.com.cn ([10.5.231.79]) by mse-fl2.zte.com.cn with SMTP id 2B5BUMBd072078; Mon, 5 Dec 2022 19:30:22 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Mon, 5 Dec 2022 19:30:25 +0800 (CST) Date: Mon, 5 Dec 2022 19:30:25 +0800 (CST) X-Zmail-TransId: 2b04638dd651ffffffffb0f9510b X-Mailer: Zmail v1.0 Message-ID: <202212051930256039214@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIGFvZTogdXNlIHN0cnNjcHkoKSB0byBpbnN0ZWFkIG9mIHN0cm5jcHkoKQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2B5BUMBd072078 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 638DD652.000 by FangMail milter! X-FangMail-Envelope: 1670239827/4NQhDf72jfz8R040/638DD652.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 638DD652.000/4NQhDf72jfz8R040 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/block/aoe/aoenet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index 63773a90581d..c51ea95bc2ce 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c @@ -39,8 +39,7 @@ static struct ktstate kts; #ifndef MODULE static int __init aoe_iflist_setup(char *str) { - strncpy(aoe_iflist, str, IFLISTSZ); - aoe_iflist[IFLISTSZ - 1] = '\0'; + strscpy(aoe_iflist, str, IFLISTSZ); return 1; } -- 2.15.2