mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tung Quang Nguyen <tung.quang.nguyen@est.tech>
To: Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>,
	"jmaloy@redhat.com" <jmaloy@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"tipc-discussion@lists.sourceforge.net"
	<tipc-discussion@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] Removing deprecated strncpy()
Date: Fri, 11 Apr 2025 01:10:24 +0000	[thread overview]
Message-ID: <PRAP189MB1897ABBF1EB2124C3F4FD05BC6B62@PRAP189MB1897.EURP189.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250410123250.64993-1-kevinpaul468@gmail.com>

>which isn't really convenient for short strings as it may cause performce issues
Typo: /performce/performance
Also please append net-next to [PATCH] in your email subject.
>
>strscpy() is a preffered replacement because it overcomes the limitations of
>strncpy mentioned above
>
>Compile Tested
>Signed-off-by: Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>
>---
> net/tipc/link.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/net/tipc/link.c b/net/tipc/link.c index 50c2e0846ea4..4859b3ccc094
>100644
>--- a/net/tipc/link.c
>+++ b/net/tipc/link.c
>@@ -2227,7 +2227,7 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct
>sk_buff *skb,
> 			break;
> 		if (msg_data_sz(hdr) < TIPC_MAX_IF_NAME)
> 			break;
>-		strncpy(if_name, data, TIPC_MAX_IF_NAME);
>+		strscpy(if_name, data, TIPC_MAX_IF_NAME);
Could you please do the same replacement in function tipc_node_get_linkname() (node.c) ?

>
> 		/* Update own tolerance if peer indicates a non-zero value */
> 		if (tipc_in_range(peers_tol, TIPC_MIN_LINK_TOL,
>TIPC_MAX_LINK_TOL)) {
>--
>2.39.5
>


  reply	other threads:[~2025-04-11  1:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 12:32 Kevin Paul Reddy Janagari
2025-04-11  1:10 ` Tung Quang Nguyen [this message]
2025-04-11  5:12   ` replacement of strncpy in ticp_node_get_linkname() Kevin Paul Reddy Janagari
  -- strict thread matches above, loose matches on Subject: below --
2025-04-11  5:06 [PATCH] Removing deprecated strncpy() Kevin Paul Reddy Janagari
2025-04-11  5:22 ` Tung Quang Nguyen
2025-04-10 11:32 Kevin Paul Reddy Janagari
2025-04-10 11:54 ` Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PRAP189MB1897ABBF1EB2124C3F4FD05BC6B62@PRAP189MB1897.EURP189.PROD.OUTLOOK.COM \
    --to=tung.quang.nguyen@est.tech \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kevinpaul468@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®