From mboxrd@z Thu Jan 1 00:00:00 1970 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 1A2C0C28B2B for ; Thu, 18 Aug 2022 21:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346624AbiHRVLS (ORCPT ); Thu, 18 Aug 2022 17:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346679AbiHRVJ5 (ORCPT ); Thu, 18 Aug 2022 17:09:57 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C86B2D8077 for ; Thu, 18 Aug 2022 14:04:34 -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=sO6GFXLR+dP7HE YmREgWHx8AWHlYypjTduLvwD5S2Pc=; b=gzh/xgve+IX2oZ/IM6H9d1Ow/Ln6yt bzV+Wf6V6bsR0Tt4TB4pFeTPo9iB9twjGGi5pTVeAPF8FSSMJa32wPgI0pU/obXM 3cRCTzFdCTHSPoK6kND3bLv0uz69YGBxQ50lIzpCSUqxIbKOWOW1uhHXLnNbjJSP 6TFWslaTHF5Sg= Received: (qmail 3962083 invoked from network); 18 Aug 2022 23:01:32 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:32 +0200 X-UD-Smtp-Session: l3s3148p1@adM3SYrmI7gucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org Subject: [PATCH 08/14] hostfs: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:17 +0200 Message-Id: <20220818210123.7637-8-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 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/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 07881b76d42f..277468783fee 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -103,7 +103,7 @@ static char *__dentry_name(struct dentry *dentry, char *name) */ BUG_ON(p + strlen(p) + 1 != name + PATH_MAX); - strlcpy(name, root, PATH_MAX); + strscpy(name, root, PATH_MAX); if (len > p - name) { __putname(name); return NULL; -- 2.35.1