]> git.proxmox.com Git - mirror_qemu.git/commit
block/curl: Do not wait for data beyond EOF
authorMax Reitz <mreitz@redhat.com>
Tue, 25 Oct 2016 02:54:31 +0000 (04:54 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 12 Dec 2016 23:48:44 +0000 (17:48 -0600)
commit48fdfebab6469d748b7e85ae96b15e052e5efe0d
treeb9bda2ab67dbe001981719ad2a6f233247dc8c50
parent6eb194ddd7a49145013df3880d78fc3bfedbee56
block/curl: Do not wait for data beyond EOF

libcurl will only give us as much data as there is, not more. The block
layer will deny requests beyond the end of file for us; but since this
block driver is still using a sector-based interface, we can still get
in trouble if the file size is not a multiple of 512.

While we have already made sure not to attempt transfers beyond the end
of the file, we are currently still trying to receive data from there if
the original request exceeds the file size. This patch fixes this issue
and invokes qemu_iovec_memset() on the iovec's tail.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20161025025431.24714-5-mreitz@redhat.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
(cherry picked from commit 4e504535c16dfa66290281e704384abfaca08673)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/curl.c