From patchwork Tue Jun 19 08:51:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE Date: Mon, 18 Jun 2012 22:51:37 -0000 From: Orit Wasserman X-Patchwork-Id: 165697 Message-Id: <1340095897-3033-1-git-send-email-owasserm@redhat.com> To: qemu-devel@nongnu.org Cc: Orit Wasserman , aliguori@us.ibm.com, avi@redhat.com, ehabkost@redhat.com, quintela@redhat.com Signed-off-by: Orit Wasserman Reviewed-by: Juan Quintela --- arch_init.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index a9e8b74..81c2e54 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); }