[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200608.191441.2171626386019874510.davem@davemloft.net>
Date: Mon, 08 Jun 2020 19:14:41 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: tannerlove.kernel@...il.com
Cc: netdev@...r.kernel.org, tannerlove@...gle.com, willemb@...gle.com
Subject: Re: [PATCH net] selftests/net: in timestamping, strncpy needs to
preserve null byte
From: Tanner Love <tannerlove.kernel@...il.com>
Date: Mon, 8 Jun 2020 15:37:15 -0400
> From: tannerlove <tannerlove@...gle.com>
>
> If user passed an interface option longer than 15 characters, then
> device.ifr_name and hwtstamp.ifr_name became non-null-terminated
> strings. The compiler warned about this:
>
> timestamping.c:353:2: warning: ‘strncpy’ specified bound 16 equals \
> destination size [-Wstringop-truncation]
> 353 | strncpy(device.ifr_name, interface, sizeof(device.ifr_name));
>
> Fixes: cb9eff097831 ("net: new user space API for time stamping of incoming and outgoing packets")
> Signed-off-by: Tanner Love <tannerlove@...gle.com>
> Acked-by: Willem de Bruijn <willemb@...gle.com>
Applied, thank you.
Powered by blists - more mailing lists