]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix race condition in qemuGetProcessInfo
authorEduardo Costa <eduardobmc@gmail.com>
Mon, 1 Dec 2014 20:24:20 +0000 (18:24 -0200)
committerEric Blake <eblake@redhat.com>
Mon, 1 Dec 2014 22:42:47 +0000 (15:42 -0700)
commitff018e686a8a412255bc34d3dc558a1bcf74fac5
tree8177d6995832e27e333b6bd6929132de205c529a
parent5f1d3c6c875fa926a657789dcb8ba4a57713dc88
Fix race condition in qemuGetProcessInfo

There is a race condition between the fopen and fscanf calls
in qemuGetProcessInfo. If fopen succeeds, there is a small
possibility that the file no longer exists before reading from it.
Now, if either fopen or fscanf calls fail, the function will behave
just as only fopen had failed.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1169055

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c