diff options
author | Sultan Alsawaf <sultanxda@gmail.com> | 2018-06-07 01:56:54 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-07 23:27:16 +0300 |
commit | 000ade8016400d93b4d7c89970d96b8c14773d45 (patch) | |
tree | 4814bfa5cffd70ee44e9b34d56a9d0759d47484c /net/ipv4 | |
parent | 52acf73b6e9a6962045feb2ba5a8921da2201915 (diff) | |
download | linux-000ade8016400d93b4d7c89970d96b8c14773d45.tar.xz |
ip_tunnel: Fix name string concatenate in __ip_tunnel_create()
By passing a limit of 2 bytes to strncat, strncat is limited to writing
fewer bytes than what it's supposed to append to the name here.
Since the bounds are checked on the line above this, just remove the string
bounds checks entirely since they're unneeded.
Signed-off-by: Sultan Alsawaf <sultanxda@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_tunnel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 38d906baf1df..c4f5602308ed 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -261,8 +261,8 @@ static struct net_device *__ip_tunnel_create(struct net *net, } else { if (strlen(ops->kind) > (IFNAMSIZ - 3)) goto failed; - strlcpy(name, ops->kind, IFNAMSIZ); - strncat(name, "%d", 2); + strcpy(name, ops->kind); + strcat(name, "%d"); } ASSERT_RTNL(); |