qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 1/1] hmp: fix "dump-quest-memory" segfault


From: Dr. David Alan Gilbert (git)
Subject: [Qemu-devel] [PULL 1/1] hmp: fix "dump-quest-memory" segfault
Date: Fri, 31 Mar 2017 12:02:44 +0100

From: Iwona Kotlarska <address@hidden>

Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing
"dump-guest-memory /dev/null 0 8192" results in segfault.
Fix by checking if we have CPU.

Signed-off-by: Iwona Kotlarska <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
   Fixed up title
---
 target/i386/arch_dump.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
index 5a2e4be..fe0aa36 100644
--- a/target/i386/arch_dump.c
+++ b/target/i386/arch_dump.c
@@ -391,8 +391,7 @@ int cpu_get_dump_info(ArchDumpInfo *info,
 
 #ifdef TARGET_X86_64
     X86CPU *first_x86_cpu = X86_CPU(first_cpu);
-
-    lma = !!(first_x86_cpu->env.hflags & HF_LMA_MASK);
+    lma = first_cpu && (first_x86_cpu->env.hflags & HF_LMA_MASK);
 #endif
 
     if (lma) {
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]