From: Ján Tomko Date: Wed, 28 Nov 2012 08:08:52 +0000 (+0100) Subject: qemu: fix a crash when save file can't be opened X-Git-Tag: CVE-2012-3411~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8927c0e;p=thirdparty%2Flibvirt.git qemu: fix a crash when save file can't be opened In qemuDomainSaveMemory, wrapperFd might be NULL and should be checked before calling virFileWrapperFdCatchError. Same in doCoreDump. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=880919 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c526f5fa4b..7892293e32 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2906,7 +2906,8 @@ qemuDomainSaveMemory(struct qemud_driver *driver, cleanup: VIR_FORCE_CLOSE(fd); - virFileWrapperFdCatchError(wrapperFd); + if (wrapperFd) + virFileWrapperFdCatchError(wrapperFd); virFileWrapperFdFree(wrapperFd); VIR_FREE(xml); @@ -3362,7 +3363,8 @@ doCoreDump(struct qemud_driver *driver, cleanup: VIR_FORCE_CLOSE(fd); if (ret != 0) { - virFileWrapperFdCatchError(wrapperFd); + if (wrapperFd) + virFileWrapperFdCatchError(wrapperFd); unlink(path); } virFileWrapperFdFree(wrapperFd);