Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp925201rwb; Thu, 18 Aug 2022 15:03:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR5zwrnYp2IMeU7602fOVx9hs6H3g65BQa3plpeCbWHXd6dkMPKi08OQj+/BtiU58JMiPCdt X-Received: by 2002:a17:902:e5cc:b0:16f:1153:c519 with SMTP id u12-20020a170902e5cc00b0016f1153c519mr4558475plf.151.1660860217130; Thu, 18 Aug 2022 15:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660860217; cv=none; d=google.com; s=arc-20160816; b=CNreMlNb2JpaseDXijvQAXQCWMBXzIG7cytgniblNR8fhYUIRaCmh8cZ9QOiJnHyXg q4Qpbclt9iimp0DpHDmgywFbWbTpaZJpDolPDLGCb1fy2whNowPFQBjPDwMbh8zJNpDy nL9+Z0uOIgyAMzaaftiFAuFpX5/HCc9AXBttWzpiBIjGhqVUM8R/QMJaiqC+tU45DJEC zcO39YgQ2/cfQGQopk+HOeztZnjLKCGKJS6lw10ax8kDLgxTLJySyOrv9glqsgMfAdXo vn8Cua5fexmN0TlO3TjdB3+R7eTQfMeUEgZJVQxv/VMxucWWGF4SpMG+dlDrYQx5Bjpl 9xUQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CpZPMJRzTaT5Den3dH8j3y6QdNozN9cLRhzsGz3m5xU=; b=W3owPkOrBeovNsGWwhUMuxBJI1GkiFuZhALYJyunhGJkImhLiwT6R03eFY76bukdTp fyZsnCD3/BC5cf1L07G9yc8H1YhVGgTf4yugyAW9xcTYnUBG4VRVxFb4XZTts4NNECXL vID95zfXEN3NQ7ZQ4wFCocv/Xx7DYVVUQ7DbixbI8KjK0yxX8Wg5cUWEQ1PYh/UTJU0E 4vxds7DV4gSTokAp8pS9Wrwc8fnE9heLz1kdGvZhuZdF2O9U44nTVu/zdiL9Dw6wLrOl uzM/KRK/+agfAfJ3e5UT4QhGdrnNKeGV9U4gW8ZxDq/JUyh9uNcnYULD7kGQT1RCKPsi Damg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=ha+06Gc6; 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 z5-20020a170902ccc500b0016d9d416df3si2083460ple.574.2022.08.18.15.03.25; Thu, 18 Aug 2022 15:03:37 -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=ha+06Gc6; 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 S1346734AbiHRVL0 (ORCPT + 99 others); Thu, 18 Aug 2022 17:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346585AbiHRVKG (ORCPT ); Thu, 18 Aug 2022 17:10:06 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D5ABD3E66 for ; Thu, 18 Aug 2022 14:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=m4VbsoCrgcEsS3 vm6DJoOd+gg8SrpIZvIbWf4GW7DUk=; b=ha+06Gc6C51lqju2c8J4yowkr0ku0d HBGgKPU2/wEw4UUBpa3ZLSHAkn3e7GScxodyGnecjYRa7LDTBsQg+aIZs169+zXr hJMziicRWS+v8AM8Rtdw/CqNycdPyd9Gb7CiDIc2+4sIIRMJDtyERKTZT4tiJKW1 aopuSbih/2VIQ= Received: (qmail 3962178 invoked from network); 18 Aug 2022 23:01:36 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:36 +0200 X-UD-Smtp-Session: l3s3148p1@+SN8SYrmXcoucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Luis de Bethencourt , Salah Triki Subject: [PATCH 12/14] befs: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:21 +0200 Message-Id: <20220818210123.7637-12-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> References: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> 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/befs/btree.c | 2 +- fs/befs/linuxvfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 1b7e0f7128d6..53b36aa29978 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -500,7 +500,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds, goto error_alloc; } - strlcpy(keybuf, keystart, keylen + 1); + strscpy(keybuf, keystart, keylen + 1); *value = fs64_to_cpu(sb, valarray[cur_key]); *keysize = keylen; diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 32749fcee090..eee9237386e2 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -374,7 +374,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){ inode->i_size = 0; inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; - strlcpy(befs_ino->i_data.symlink, raw_inode->data.symlink, + strscpy(befs_ino->i_data.symlink, raw_inode->data.symlink, BEFS_SYMLINK_LEN); } else { int num_blks; -- 2.35.1