]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix dereference of potentially freed pointer in qemudDomainSaveFlags
authorLaine Stump <laine@laine.org>
Fri, 4 Jun 2010 03:25:58 +0000 (23:25 -0400)
committerLaine Stump <laine@laine.org>
Fri, 4 Jun 2010 19:36:04 +0000 (15:36 -0400)
commit1d45e1b6225c2068359e90b48559b54d0e019aee
treed273ee8ae1d9e2de6481d633143ef116758fb7f5
parentb1eb7f2e987d21b1711e86e5cb63a69abfce82f1
Fix dereference of potentially freed pointer in qemudDomainSaveFlags

The pointer to the xml describing the domain is saved into an object
prior to calling VIR_REALLOC_N() to make the size of the memory it
points to a multiple of QEMU_MONITOR_MIGRATE_TO_FILE_BS. If that
operation needs to allocate new memory, the pointer that was saved is
no longer valid.

To avoid this situation, adjust the size *before* saving the pointer.

(This showed up when experimenting with very large values of
QEMU_MONITOR_MIGRATE_TO_FILE_BS).
src/qemu/qemu_driver.c