]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix invalid read in virCgroupGetValueStr
authorJán Tomko <jtomko@redhat.com>
Wed, 26 Jun 2013 11:07:24 +0000 (13:07 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 26 Jun 2013 13:05:43 +0000 (15:05 +0200)
commit306c49ffd56a1c72b1892d50f2a75531c62f4a1d
tree110b707ac3fb8bb3c0f3465ec4c84753e830706b
parent7070a572aa3623a2e7e834ab411fc38528f7fabb
Fix invalid read in virCgroupGetValueStr

Don't check for '\n' at the end of file if zero bytes were read.

Found by valgrind:
==404== Invalid read of size 1
==404==    at 0x529B09F: virCgroupGetValueStr (vircgroup.c:540)
==404==    by 0x529AF64: virCgroupMoveTask (vircgroup.c:1079)
==404==    by 0x1EB475: qemuSetupCgroupForEmulator (qemu_cgroup.c:1061)
==404==    by 0x1D9489: qemuProcessStart (qemu_process.c:3801)
==404==    by 0x18557E: qemuDomainObjStart (qemu_driver.c:5787)
==404==    by 0x190FA4: qemuDomainCreateWithFlags (qemu_driver.c:5839)

Introduced by 0d0b409.

https://bugzilla.redhat.com/show_bug.cgi?id=978356
src/util/vircgroup.c