]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
i40e: use correct length for strncpy
authorMitch Williams <mitch.a.williams@intel.com>
Mon, 20 Aug 2018 15:12:30 +0000 (08:12 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:28 +0000 (13:16 +0100)
commita77677b94187a41dd682e69b7d050969851988c7
treed903a66cd92a5f193f62ce23e48f7b5af1a000e0
parent452a0203f28c813a202e6da9407ea7107be57580
i40e: use correct length for strncpy

BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64 ]

Caught by GCC 8. When we provide a length for strncpy, we should not
include the terminating null. So we must tell it one less than the size
of the destination buffer.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/intel/i40e/i40e_ptp.c