projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
536a6c8
)
net: ip_tunnel: use strscpy to replace strlcpy
author
XueBing Chen
<chenxuebing@jari.cn>
Mon, 11 Jul 2022 13:55:37 +0000
(21:55 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Wed, 13 Jul 2022 01:31:57 +0000
(18:31 -0700)
The strlcpy should not be used because it doesn't limit the source
length. Preferred is strscpy.
Signed-off-by: XueBing Chen <chenxuebing@jari.cn>
Link:
https://lore.kernel.org/r/2a08f6c1.e30.181ed8b49ad.Coremail.chenxuebing@jari.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/ip_tunnel.c
patch
|
blob
|
history
diff --git
a/net/ipv4/ip_tunnel.c
b/net/ipv4/ip_tunnel.c
index
94017a8
..
4688f00
100644
(file)
--- a/
net/ipv4/ip_tunnel.c
+++ b/
net/ipv4/ip_tunnel.c
@@
-242,7
+242,7
@@
static struct net_device *__ip_tunnel_create(struct net *net,
if (parms->name[0]) {
if (!dev_valid_name(parms->name))
goto failed;
- str
l
cpy(name, parms->name, IFNAMSIZ);
+ str
s
cpy(name, parms->name, IFNAMSIZ);
} else {
if (strlen(ops->kind) > (IFNAMSIZ - 3))
goto failed;
@@
-1065,7
+1065,7
@@
int ip_tunnel_init_net(struct net *net, unsigned int ip_tnl_net_id,
memset(&parms, 0, sizeof(parms));
if (devname)
- str
l
cpy(parms.name, devname, IFNAMSIZ);
+ str
s
cpy(parms.name, devname, IFNAMSIZ);
rtnl_lock();
itn->fb_tunnel_dev = __ip_tunnel_create(net, ops, &parms);