]> git.proxmox.com Git - mirror_qemu.git/commit - hw/9pfs/9p-synth.c
hw/9pfs: avoid buffer overrun
authorJim Meyering <meyering@redhat.com>
Thu, 4 Oct 2012 11:09:49 +0000 (13:09 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 5 Oct 2012 12:58:37 +0000 (07:58 -0500)
commita79b5f8b80890b402fdb0733b0a073695a7875b5
tree99a6f22f139239defa1cb0b4ea9ca66e142eccf6
parentd66f8e7bd3de4a2ecf0680c635f870f2138425b8
hw/9pfs: avoid buffer overrun

v9fs_add_dir_node and qemu_v9fs_synth_add_file used strncpy
to form node->name, which requires NUL-termination, but
strncpy does not ensure NUL-termination.
Use pstrcpy, which does.

Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/9pfs/virtio-9p-synth.c