]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Make qiov match the request size until EOF
authorKevin Wolf <kwolf@redhat.com>
Thu, 3 Jul 2014 11:21:24 +0000 (13:21 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:20 +0000 (12:03 +0200)
commit33f461e0c5d8efa21ef7e746be561fc57a1df106
tree1076acaa9ac0a50423d0a72f5639a6e684d8827e
parent0ceb849bd336a5f9b6e1ed56d45cf5773d251ad8
block: Make qiov match the request size until EOF

If a read request goes across EOF, the block driver sees a shortened
request that stops at EOF (the rest is memsetted in block.c), however
the original qiov was used for this request.

This patch makes the qiov size match the request size, avoiding a
potential buffer overflow in raw-posix.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c