Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/net: in timestamping, strncpy needs to preserve null byte
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: cb9eff0 ("net: new user space API for time stamping of incoming and outgoing packets") Signed-off-by: Tanner Love <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information