]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
nvme-core: rework a NQN copying operation
authorBart Van Assche <bvanassche@acm.org>
Thu, 17 Jan 2019 08:31:07 +0000 (16:31 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
commit8651d0eb778d34af9eed96391ff750c82c1309ec
tree5dd2f3aa4353bc4ef7bbca87dbac3f0b7eb0057f
parenta402714cdfab5e89cb8d933c9fb95ef941297c57
nvme-core: rework a NQN copying operation

BugLink: https://bugs.launchpad.net/bugs/1811755
Although it is easy to see that the code in nvme_init_subnqn() guarantees that
the subsys->nqn string is '\0'-terminated, apparently Coverity is not smart
enough to see this. Make it easier for Coverity to analyze this code by changing
the strncpy() call into a strlcpy() call. This patch does not change the
behavior of the code but fixes Coveritiy ID 1423720.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
(cherry picked from commit bb2a1d4e804aa41eef0003a192a674f844dbca23)
Signed-off-by: Anthony Wong <anthony.wong@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/nvme/host/core.c