]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix two issues in qemuDomainSetVcpus error handling
authorJohn Ferlan <jferlan@redhat.com>
Wed, 18 Mar 2015 11:10:54 +0000 (07:10 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 18 Mar 2015 22:11:22 +0000 (18:11 -0400)
commite06e6f1ee39a6d4109dcb7b8e1eef2b62b37da38
treeaf8ec11d41432261f906b6c7dd0776006c1dcecd
parent060f4c666e1b2fe81ec3e21ef28a262a290471f4
qemu: Fix two issues in qemuDomainSetVcpus error handling

Issue #1 - A call to virBitmapNew did not check if the allocation
failed which could lead to a NULL dereference

Issue #2 - When deleting the pin entries from the config file, the
code loops from the number of elements down to the "new" vcpu count;
however, the pin id values are numbered 0..n-1 not 1..n, so the "first"
pin attempt would never work. Luckily the check was for whether the
incoming 'n' (vcpu id) matched the entry in the array from 0..arraysize
rather than a dereference of the 'n' entry
src/qemu/qemu_driver.c