提交 637f7a6a 编写于 作者: A Avi Kivity

vhost: fix mem_sections memory corruption

A memset() used to delete an entry in an array did not take into account
the array element's size.
Signed-off-by: NAvi Kivity <avi@redhat.com>
Acked-by: NMichael S. Tsirkin <mst@redhat.com>
上级 d743c382
......@@ -456,7 +456,7 @@ static void vhost_region_del(MemoryListener *listener,
== section->offset_within_address_space) {
--dev->n_mem_sections;
memmove(&dev->mem_sections[i], &dev->mem_sections[i+1],
dev->n_mem_sections - i);
(dev->n_mem_sections - i) * sizeof(*dev->mem_sections));
break;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册