[Libvir] PATCH: Fix crash parsing input devices for QEMU

Daniel P. Berrange berrange at redhat.com
Thu Sep 27 20:53:26 UTC 2007


There is an edge case in parsing of input devices where if you have a PS2
mouse defined, before a USB tablet, it could generate a null pointer
deference & thus crash. Normally you'd only have one pointer defined, but
one might add a USB tablet for getting a improved mouse experience.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
-------------- next part --------------
Index: src/qemu_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.14
diff -u -p -r1.14 qemu_conf.c
--- src/qemu_conf.c	21 Sep 2007 21:20:32 -0000	1.14
+++ src/qemu_conf.c	26 Sep 2007 00:42:05 -0000
@@ -1312,7 +1312,7 @@ static struct qemud_vm_def *qemudParseXM
             }
             def->ninputs++;
             input->next = NULL;
-            if (i == 0) {
+            if (def->inputs == NULL) {
                 def->inputs = input;
             } else {
                 prev->next = input;


More information about the libvir-list mailing list