]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix crash on OOM in qemuAddRBDHost
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 23 Sep 2013 13:11:34 +0000 (14:11 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 24 Sep 2013 09:52:26 +0000 (10:52 +0100)
commit0bea528a33898c818986302574a2f41681dcbb28
treed2c45d73c4bf6b046e994738528916c132b99218
parentba19783d9bd2e1d2e1c517b2bcb231c0a85aed54
Fix crash on OOM in qemuAddRBDHost

When parsing the RBD hosts, it increments the 'nhosts' counter
before increasing the 'hosts' array allocation. If an OOM then
occurs when increasing the array allocation, the cleanup block
will attempt to access beyond the end of the array. Switch
to using VIR_EXPAND_N instead of VIR_REALLOC_N to protect against
this mistake

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_command.c