Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5123423rwb; Mon, 21 Nov 2022 17:12:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf57W94dUEhZC9gj3Vxvaa9hw47/oF6bZDop99zM8GE/FcZx+1Pn9p4ONtOn6vWO0B/cCJT6 X-Received: by 2002:a17:906:114b:b0:7ab:1b4c:ac6e with SMTP id i11-20020a170906114b00b007ab1b4cac6emr4254491eja.669.1669079554862; Mon, 21 Nov 2022 17:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669079554; cv=none; d=google.com; s=arc-20160816; b=bsOjrPTsHpFMK9UC6R/6O5Jje2oVXil1pl3F0vdnlPrrxD/Vo/TypBwas+wOMut1kU b2eN0gPUpWq7oKNfR5K3aX0xVYTE84mCnFeCj69cMULPVmFfnJNL89aM4o9B2G9+arcF lF+gf/hCgpL0t7VnH3rH7oD+Xj1K56h0IGzOXyDe1pR7nEvuI5gMZAbNr00IPFAeKIZ9 wXxO8ulwmSYLjsMhBRpP0qYy80Nwj85b5iqiJN0AMoDVQUfd7J0k0gYcIG0Mvb/SQn/C DV7rfmgwg/uI+MidGtpOEHxcheavD7TWlz3gzbVY6QjeAJMO7/bVy7npOI4DUZO+Fo5n y+oQ== 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=e/pjlcFpwOsq9IBVvrvrl0b7LffjxTRmXkiYJk1uIcQ=; b=gnXwW8bHmNttld27cjVPIZYKv8lQvKEhjuGJqrgDu70aXdCUupdM3SPMrOeGNFYxq5 Lt9qYlm48vV6ryMkntLquSnsR1JgqDO+DYBqgiV1oqNvM8LIPcSr8+81yKGuF3YLipRt Fmu1RSTX0joYfgzzQmquaNtrMwGXk4R13Xzgmh7SAKBTbt+8cbeOQvstIp79aSbkgaGy BuSLc94QXp0KrZyrD5zIra/HyxkQxJCdWey4VoGAHKKoMMyjyGEZ6NmChVc8jy0/Ba8a pBoYjiuaE8cwSWtmhefZIG3s8hDcAI2Mz5xq2Y4NbAXscV/bvF5tVsdw3ezoM7zpgQqH Sf+w== 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 sg34-20020a170907a42200b00791a7e441a3si11483710ejc.459.2022.11.21.17.11.58; Mon, 21 Nov 2022 17:12:34 -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 S231519AbiKVA61 (ORCPT + 91 others); Mon, 21 Nov 2022 19:58:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbiKVA6X (ORCPT ); Mon, 21 Nov 2022 19:58:23 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F401568C4E; Mon, 21 Nov 2022 16:58:19 -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 4NGQqG0KGfz4xVnf; Tue, 22 Nov 2022 08:58:18 +0800 (CST) Received: from szxlzmapp01.zte.com.cn ([10.5.231.85]) by mse-fl2.zte.com.cn with SMTP id 2AM0wDIn085676; Tue, 22 Nov 2022 08:58:13 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Tue, 22 Nov 2022 08:58:13 +0800 (CST) Date: Tue, 22 Nov 2022 08:58:13 +0800 (CST) X-Zmail-TransId: 2b04637c1ea5ffffffff854dfe8c X-Mailer: Zmail v1.0 Message-ID: <202211220858139474929@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHZib3hmczogdXNlIHN0cnNjcHkoKSBpcyBtb3JlIHJvYnVzdCBhbmQgc2FmZXI=?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AM0wDIn085676 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 637C1EAA.000 by FangMail milter! X-FangMail-Envelope: 1669078698/4NGQqG0KGfz4xVnf/637C1EAA.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637C1EAA.000/4NGQqG0KGfz4xVnf 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. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- fs/vboxsf/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c index d2f6df69f611..1fb8f4df60cb 100644 --- a/fs/vboxsf/super.c +++ b/fs/vboxsf/super.c @@ -176,7 +176,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc) } folder_name->size = size; folder_name->length = size - 1; - strlcpy(folder_name->string.utf8, fc->source, size); + strscpy(folder_name->string.utf8, fc->source, size); err = vboxsf_map_folder(folder_name, &sbi->root); kfree(folder_name); if (err) { -- 2.15.2