diff options
author | tannerlove <tannerlove@google.com> | 2020-06-08 22:37:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-24 18:49:07 +0300 |
commit | 394869c49ff5eee34dc05f19a8b5d7c100d415c7 (patch) | |
tree | d31f594c3b4636eed61117d85019bd014ef989c5 /tools/testing/selftests/media_tests | |
parent | 455fd835e4f7c241727f41a142e29f44f46b290b (diff) | |
download | linux-394869c49ff5eee34dc05f19a8b5d7c100d415c7.tar.xz |
selftests/net: in timestamping, strncpy needs to preserve null byte
[ Upstream commit 8027bc0307ce59759b90679fa5d8b22949586d20 ]
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@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing/selftests/media_tests')
0 files changed, 0 insertions, 0 deletions