Skip to contentSkip to conversation

Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE

PATCH In review Orit Wasserman 2 participants 2 messages Jun 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE

---
 arch_init.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch_init.c +3 -0
index a9e8b74..81c2e54 100644
@@ -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);
         }
Signature · 1 line
1.7.7.6