]> xenbits.xensource.com Git - libvirt.git/commitdiff
avoid a segfault on CD eject in KVM/QEmu
authorDaniel Veillard <veillard@redhat.com>
Wed, 3 Sep 2008 12:52:27 +0000 (12:52 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 3 Sep 2008 12:52:27 +0000 (12:52 +0000)
* src/qemu_driver.c: patch from Cole Robinson to avoid a segfault
  on KVM CD eject
Daniel

ChangeLog
src/qemu_driver.c

index f504f0750f8bae9865695e33e150786ca4eaefe7..6570f8886ee1be7cefcf640205d231c70553f431 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep  3 14:51:03 CEST 2008 Daniel Veillard <veillard@redhat.com>
+
+       * src/qemu_driver.c: patch from Cole Robinson to avoid a segfault
+         on KVM CD eject
+
 Wed Sep  3 14:37:06 CEST 2008 Daniel Veillard <veillard@redhat.com>
 
        * src/virsh.c: patch from Cole Robinson to add output on attach
index eb4454a5a57333ad6ffa6897909370a0a1cb1581..f71b6e8569f1e3d92c1bb5802d1d378740e3d3c9 100644 (file)
@@ -2974,7 +2974,10 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
     }
     VIR_FREE(reply);
     VIR_FREE(cmd);
-    strcpy(olddisk->src, newdisk->src);
+
+    VIR_FREE(olddisk->src);
+    olddisk->src = newdisk->src;
+    newdisk->src = NULL;
     olddisk->type = newdisk->type;
     return 0;
 }