diff options
author | Stefan Weil <sw@weilnetz.de> | 2012-08-17 15:50:44 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-08-31 10:05:22 -0500 |
commit | 8bd6b06d7b718b3e595aab279699ef3651ce2e48 (patch) | |
tree | 893c4c89180f45fa9a5798b25b0e5540fd39cbfe /console.c | |
parent | 23aec6005af30e29180496b434edcc51660ce94e (diff) | |
download | qemu-8bd6b06d7b718b3e595aab279699ef3651ce2e48.zip qemu-8bd6b06d7b718b3e595aab279699ef3651ce2e48.tar.gz qemu-8bd6b06d7b718b3e595aab279699ef3651ce2e48.tar.bz2 |
console: Fix warning from clang (and potential crash)
ccc-analyzer reports this warning:
console.c:1090:29: warning: Dereference of null pointer
if (active_console->cursor_timer) {
^
Function console_select allows active_console to be NULL,
but would crash when accessing cursor_timer. Fix this.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'console.c')
-rw-r--r-- | console.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1087,7 +1087,7 @@ void console_select(unsigned int index) if (s) { DisplayState *ds = s->ds; - if (active_console->cursor_timer) { + if (active_console && active_console->cursor_timer) { qemu_del_timer(active_console->cursor_timer); } active_console = s; |