提交 fd5f3b63 编写于 作者: M Michael S. Tsirkin 提交者: Amit Shah

cpu: assert host pointer offset within block

Make accesses safer in case we missed some
check somewhere.
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: NAmos Kong <akong@redhat.com>
Signed-off-by: NAmit Shah <amit.shah@redhat.com>
上级 1240be24
......@@ -315,6 +315,7 @@ typedef struct RAMBlock {
static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset)
{
assert(offset < block->length);
return (char *)block->host + offset;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册