aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Jia <ajia@redhat.com>2012-02-16 10:32:03 +0800
committerDoug Goldstein <cardoe@cardoe.com>2012-02-19 16:53:54 -0600
commit414b0e56a640015d6ba0bc29a8a1d36348c76d72 (patch)
tree54747a50cdaf330f23a1d93a566a481ff5d43bcf
parentqemu: Unlock monitor when connecting to dest qemu fails (diff)
downloadlibvirt-v0.9.10-gentoo.tar.gz
libvirt-v0.9.10-gentoo.tar.bz2
libvirt-v0.9.10-gentoo.zip
qemu: Prevent crash of libvirtd without guest agentv0.9.10-gentoo-1v0.9.10-gentoo
* src/qemu/qemu_process.c (qemuFindAgentConfig): avoid crash libvirtd due to deref a NULL pointer. * How to reproduce? 1. virsh edit the following xml into guest configuration: <channel type='pty'> <target type='virtio'/> </channel> 2. virsh start <domain> or % virt-install -n foo -r 1024 --disk path=/var/lib/libvirt/images/foo.img,size=1 \ --channel pty,target_type=virtio -l <installation tree> Signed-off-by: Alex Jia <ajia@redhat.com>
-rw-r--r--src/qemu/qemu_process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2d92d66a0..ac9496156 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -193,7 +193,7 @@ qemuFindAgentConfig(virDomainDefPtr def)
if (channel->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO)
continue;
- if (STREQ(channel->target.name, "org.qemu.guest_agent.0")) {
+ if (STREQ_NULLABLE(channel->target.name, "org.qemu.guest_agent.0")) {
config = &channel->source;
break;
}