Skip to content

Commit 7c594bb

Browse files
author
Miklos Szeredi
committed
virtiofs: use strscpy for copying the queue name
Always null terminate fsvq->name. Reported-by: kernel test robot <[email protected]> Fixes: b43b7e8 ("virtiofs: provide a helper function for virtqueue initialization") Signed-off-by: Miklos Szeredi <[email protected]>
1 parent a390ccb commit 7c594bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fuse/virtio_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ static void virtio_fs_vq_done(struct virtqueue *vq)
649649
static void virtio_fs_init_vq(struct virtio_fs_vq *fsvq, char *name,
650650
int vq_type)
651651
{
652-
strncpy(fsvq->name, name, VQ_NAME_LEN);
652+
strscpy(fsvq->name, name, VQ_NAME_LEN);
653653
spin_lock_init(&fsvq->lock);
654654
INIT_LIST_HEAD(&fsvq->queued_reqs);
655655
INIT_LIST_HEAD(&fsvq->end_reqs);

0 commit comments

Comments
 (0)