diff options
-rw-r--r-- | arch_init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch_init.c b/arch_init.c index a9e8b7442b..81c2e5443f 100644 --- a/arch_init.c +++ b/arch_init.c @@ -483,6 +483,9 @@ int ram_load(QEMUFile *f, void *opaque, int version_id) void *host; host = host_from_stream_offset(f, addr, flags); + if (!host) { + return -EINVAL; + } qemu_get_buffer(f, host, TARGET_PAGE_SIZE); } |