]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: avoid null pointer dereference
authorEric Blake <eblake@redhat.com>
Tue, 3 May 2011 15:36:12 +0000 (09:36 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 3 May 2011 16:59:55 +0000 (10:59 -0600)
commit4d080ee4034620d3832c42d804150ca8d78a4b28
tree5655a225411047aa5ceb74890aa76c8478cc7747
parent4b4e8b57c2a652dd7e19c04d0b06c7a7e11e6f0c
qemu: avoid null pointer dereference

This code has had problems historically.  As originally
written, in commit 6bcf2501 (Jun 08), it could call unlink
on a random string, nuking an unrelated file.

Then commit 182a80b9 (Sep 09), the code was rewritten to
allocate tmp, with both a use-after-free bug and a chance to
call unlink(NULL).

Commit e206946 (Mar 11) fixed the use-after-free, but not the
NULL dereference.  Thanks to clang for catching this!

* src/qemu/qemu_driver.c (qemudDomainMemoryPeek): Don't call
unlink on NULL.
src/qemu/qemu_driver.c