]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: check for buffer errors before virBufferUse
authorJán Tomko <jtomko@redhat.com>
Tue, 27 Jun 2017 14:33:22 +0000 (16:33 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 2 Aug 2017 13:49:23 +0000 (15:49 +0200)
commit7330a36579416cb229939336d2a0dece20d7e310
treed5c5f5f7815bdaa768666da2b617beb711c1a79e
parent338c74dacd3449b73aca2571c081a599595fea9f
conf: check for buffer errors before virBufferUse

After an OOM error, virBuffer* APIs set buf->use to zero.
Adding a buffer to the parent buffer only if use is non-zero
would quietly drop data on error.

Check the error beforehand to make sure buf->use is zero
because we have not attempted to add anything to it.
src/conf/capabilities.c
src/conf/cpu_conf.c
src/conf/domain_conf.c