mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Cc: David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"open list:NETWORKING [IPv4/IPv6]" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ipv6: replace sprintf() with no format specifiers with strscpy()
Date: Thu, 10 Sep 2026 15:09:10 +0800	[thread overview]
Message-ID: <aqJXluR9b-5p76ei@fedora> (raw)
In-Reply-To: <20260909210552.51828-1-lalitshankarch@gmail.com>

Hi Lalit,
On Wed, Sep 09, 2026 at 09:05:52PM +0000, Lalit Shankar Chowdhury wrote:
> Multiple instances of sprintf() have no format specifiers. Replace
> them with strscpy().
> 
> Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
> ---
>  net/ipv6/ip6_tunnel.c | 2 +-
>  net/ipv6/ip6_vti.c    | 2 +-
>  net/ipv6/ip6mr.c      | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
> index d5ff50a2ac01..ef3a6d931c9e 100644
> --- a/net/ipv6/ip6_tunnel.c
> +++ b/net/ipv6/ip6_tunnel.c
> @@ -294,7 +294,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
>  			goto failed;
>  		strscpy(name, p->name, IFNAMSIZ);
>  	} else {
> -		sprintf(name, "ip6tnl%%d");
> +		strscpy(name, "ip6tnl%d", IFNAMSIZ);

The sprintf() is doing format expansion (%% -> %), the name will be used
in __dev_alloc_name() later. I think there is no need to change them.

Thanks
Hangbin

  reply	other threads:[~2026-09-10  7:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 21:05 Lalit Shankar Chowdhury
2026-09-10  7:09 ` Hangbin Liu [this message]
2026-09-10 10:54 ` David Laight

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=aqJXluR9b-5p76ei@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=lalitshankarch@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.com \
    /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®