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

[Xen-changelog] [qemu-upstream-unstable] console: Fix segfault on screendump without VGA adapter



commit 986626efecae87af17a9d9726767501cb4687b8c
Author: Alexander Graf <agraf@xxxxxxx>
Date:   Fri Nov 18 16:41:59 2011 +0100

    console: Fix segfault on screendump without VGA adapter
    
    When trying to create a screen dump without having any VGA adapter
    inside the guest, QEMU segfaults.
    
    This is because it's trying to switch back to the "previous" screen
    it was on before dumping the VGA screen. Unfortunately, in my case
    there simply is no previous screen so it accesses a NULL pointer.
    
    Fix it by checking if previous_active_console is actually available.
    
    This is 1.0 material.
    
    Signed-off-by: Alexander Graf <agraf@xxxxxxx>
---
 console.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/console.c b/console.c
index f6fe441..ed6a653 100644
--- a/console.c
+++ b/console.c
@@ -186,7 +186,9 @@ void vga_hw_screen_dump(const char *filename)
         consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
     }
 
-    console_select(previous_active_console->index);
+    if (previous_active_console) {
+        console_select(previous_active_console->index);
+    }
 }
 
 void vga_hw_text_update(console_ch_t *chardata)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.