nvme: fix KASAN warning when parsing host nqn
The host nqn actually is smaller than the space reserved for it, so we should be using strlcpy to keep KASAN happy. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
eb464833a2
commit
1e5f446162
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ static struct nvmf_host *nvmf_host_add(const char *hostnqn)
|
|||
goto out_unlock;
|
||||
|
||||
kref_init(&host->ref);
|
||||
memcpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
|
||||
strlcpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
|
||||
|
||||
list_add_tail(&host->list, &nvmf_hosts);
|
||||
out_unlock:
|
||||
|
|
Loading…
Reference in a new issue