[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PRAP189MB1897827A01B6C6827EEE1CB3C6B62@PRAP189MB1897.EURP189.PROD.OUTLOOK.COM>
Date: Fri, 11 Apr 2025 05:22:10 +0000
From: Tung Quang Nguyen <tung.quang.nguyen@....tech>
To: Kevin Paul Reddy Janagari <kevinpaul468@...il.com>, "jmaloy@...hat.com"
<jmaloy@...hat.com>
CC: "davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
<edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>, "horms@...nel.org"
<horms@...nel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] Removing deprecated strncpy()
>This patch suggests the replacement of strncpy with strscpy as per
>Documentation/process/deprecated.
>The strncpy() fails to guarntee NULL termination, The function adds zero pads
>which isn't really convenient for short strings as it may cause performce issues
>
>strscpy() is a preffered replacement because it overcomes the limitations of
>strncpy mentioned above
>
Please read my comment for your previous patch:
- Add "net-next" to your email subject like this: [PATCH net-next]
- Fix many typos in your changelog: guarntee -> guarantee, performce --> performance, preffered --> preferred
>Compile Tested
>
>Signed-off-by: Kevin Paul Reddy Janagari <kevinpaul468@...il.com>
>---
> net/tipc/node.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/net/tipc/node.c b/net/tipc/node.c index
>ccf5e427f43e..cb43f2016a70 100644
>--- a/net/tipc/node.c
>+++ b/net/tipc/node.c
>@@ -1581,7 +1581,7 @@ int tipc_node_get_linkname(struct net *net, u32
>bearer_id, u32 addr,
> tipc_node_read_lock(node);
> link = node->links[bearer_id].link;
> if (link) {
>- strncpy(linkname, tipc_link_name(link), len);
>+ strscpy(linkname, tipc_link_name(link), len);
please merge this change into your previous patch. We do not need a separate patch for the same purpose.
Powered by blists - more mailing lists