From patchwork Thu Aug 18 21:01:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12947945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C61AAC00140 for ; Thu, 18 Aug 2022 21:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346648AbiHRVLU (ORCPT ); Thu, 18 Aug 2022 17:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346636AbiHRVKR (ORCPT ); Thu, 18 Aug 2022 17:10:17 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C58D3E50 for ; Thu, 18 Aug 2022 14:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=N6BywkBKgygX/iq/S3KMnIP0Yhx fcMiSe4kDyKM/6zk=; b=Q2YOWVcUDEzkF7t58QCJyAHr03rA8IDBS6z2q587skp PafUOIw7SWP14JyC99qsuW3VJwejfTvRZX5UfTZ43F3iIJKoNJloRaDCLX7KfnvM ZcdAe1DrCsghMbX3vhfe2q2pkVYweKB5BMTsBCFz/VgClnePRGeOsbJPzjGT/dyk = Received: (qmail 3962593 invoked from network); 18 Aug 2022 23:01:55 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:55 +0200 X-UD-Smtp-Session: l3s3148p1@a32ZSormAOIucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Hans de Goede , linux-fsdevel@vger.kernel.org Subject: [PATCH] vboxsf: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:54 +0200 Message-Id: <20220818210154.8119-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Reviewed-by: Hans de Goede --- 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) {