Skip to content
Snippets Groups Projects
Commit facf98ad authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Anthony Liguori
Browse files

qemu/iovec: Don't assert if sbytes is zero


Since these values can possibly be sent from guest (for hw/9pfs), do a sanity check
on them. A 9p write request with 0 bytes caused qemu to abort without this patch

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent ddcb73b7
No related branches found
No related tags found
No related merge requests found
......@@ -304,6 +304,10 @@ void qemu_iovec_concat_iov(QEMUIOVector *dst,
{
int i;
size_t done;
if (!sbytes) {
return;
}
assert(dst->nalloc != -1);
for (i = 0, done = 0; done < sbytes && i < src_cnt; i++) {
if (soffset < src_iov[i].iov_len) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment