From b78accf6147a87a3d9c1cd4287d7a1ff805f358e Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 12 Nov 2014 11:44:47 +0200 Subject: cpu: verify that block->host is set If it isn't, access at an offset will cause memory corruption. Signed-off-by: Michael S. Tsirkin Reviewed-by: Paolo Bonzini Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Amos Kong Signed-off-by: Amit Shah --- include/exec/cpu-all.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 7c3a5e7dd0..62f558103d 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -316,6 +316,7 @@ typedef struct RAMBlock { static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset) { assert(offset < block->length); + assert(block->host); return (char *)block->host + offset; } -- cgit v1.2.1