console: Avoid dereferencing NULL active_console
commit358664cc6d1b5f7c36004be0179b36011b81c49d
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 20 Sep 2010 13:11:19 +0000 (20 14:11 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 3 Oct 2010 06:43:10 +0000 (3 06:43 +0000)
treee4ed0b46de41e0bd7f7bc515a1562df6fd5f5737
parent7fd3f494409775b491ca08f9026c45da13852a6d
console: Avoid dereferencing NULL active_console

The console_select() function does not check that active_console is
non-NULL before dereferencing it.  When invoked with qemu -nodefaults it
is possible to hit this case.

This patch checks that active_console is non-NULL before stashing away
the old console dimensions in console_select().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
console.c