]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-core: rework a NQN copying operation
authorBart Van Assche <bvanassche@acm.org>
Mon, 8 Oct 2018 21:28:41 +0000 (14:28 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 17 Oct 2018 06:58:25 +0000 (08:58 +0200)
commit7dce3ea68e593f3f8c0086c1c94fa33da80a416b
treefdfcb948583ac36643ff698f35d019189af742a6
parent676b4086a20b1c95508ef01c496caceeccd3b313
nvme-core: rework a NQN copying operation

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>
drivers/nvme/host/core.c