Make accesses safer in case we missed some
check somewhere.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
---
 include/exec/cpu-all.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 9d8d408..7c3a5e7 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -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;
 }
 
-- 
MST


Reply via email to