Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp912552rwb; Thu, 18 Aug 2022 14:46:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6vv+1HLkI54BTuuF1fadxNm+SsxFGdEjBo8evMDfBeLxkJvj01CG8VkusT51MuEhIef4IE X-Received: by 2002:a63:385d:0:b0:429:c235:8b3e with SMTP id h29-20020a63385d000000b00429c2358b3emr3839613pgn.5.1660859207700; Thu, 18 Aug 2022 14:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660859207; cv=none; d=google.com; s=arc-20160816; b=f/jBVNkrg1EIxFFbEuhXaxeJ737Jjc6V80sKTBzTOZQXli5kB0MBbikEev++XfYbN6 stgTGFyo36KOwkqExaErOiW1FckMFsjWY6trVF0QAOZgc+P7eVNiOneBFKPvXj7KxzVg 978fXtzK+ogQP3k8/Mva6oXkT1THFrUWS2CXrFRjKVenwH0/yeDFzxr3XoclXHcEDrrJ 7wIDE7ay2tC3ZkGU41tPkAJCK9a20O+xDhr3reKvKr3oyjkcvEw2z1PO2G7dWgljXBgD cVL2GVKsU+DKmuaiRPZtpHwbB1qbTuv1mQQN6WBwr1K6L5xSOUooU3Ut98ARXNyHlLeh T8yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1aH7/e3ZXYn3Oh9VXRJ7Mw/YlWN+XZdGJy7Z9qXYOuk=; b=oDtX5GCGA1OU9SR/TDCdupMfJ3GLsjZaP6nh+68anhtvk/jhFTxovcGZ7i/B7zrjY4 Rpbwl7R6A3tgWaVLPJiEGUdefrIx1NSbhWvcqtmPScBtfBj8Utn/qwgPwYaFg0M2xE2X RmJvtcESOFMk9PSDYzERdlhKi3pxKM8NoN/Ii5647iDt1+8AX71tkB8wYwAIVPT+nArA liUPLT6xZnB9afKYpjew3ZjeILbO5fcbxu8JcuwD3dcahMYtUG7U2L7hEXjzd+siB2Jl lftxuTDv6rhQJJspxOtjhNocTelGeSu8ZxTbsGZ8lwdb8bEPXxqkuM25mGUaZsVPkc1N ywYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=Q2YOWVcU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i69-20020a638748000000b0041d4b75332csi2216555pge.339.2022.08.18.14.46.36; Thu, 18 Aug 2022 14:46:47 -0700 (PDT) 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; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=Q2YOWVcU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346714AbiHRVMR (ORCPT + 99 others); Thu, 18 Aug 2022 17:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346702AbiHRVKQ (ORCPT ); Thu, 18 Aug 2022 17:10:16 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C8ED8B08 for ; Thu, 18 Aug 2022 14:05:00 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 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 --- 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.35.1