aboutsummaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorOrit Wasserman <owasserm@redhat.com>2012-06-19 11:51:37 +0300
committerJuan Quintela <quintela@redhat.com>2012-06-29 10:38:28 +0200
commit0ff1f9f585712684dc46cb6cb6a46a8cc160b2ae (patch)
treeb85c1a9f3d85af4168d7ebaed97267bfdd2e3d13 /arch_init.c
parent71ea2e016131a9fcde6f1ffd3e0e34a64c21f593 (diff)
Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c3
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);
}