]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virconf: fix off-by-1 when appending \n to config file
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 8 Jul 2016 13:47:20 +0000 (14:47 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 12 Jul 2016 08:57:00 +0000 (09:57 +0100)
commitfe2d37295eeb6bfa6345cfa9648edbec58d0c485
tree68ab628373c5d96b551ba85fa51cc99b21a6fa42
parent776925096d307bf2f46b178ad6758fee6be197f3
virconf: fix off-by-1 when appending \n to config file

If the config file does not end with a \n, the parser will append
one. When re-allocating the array though, it is mistakenly assuming
that 'len' is the length including the trailing NUL, but it does
not. So we must add 2 to len, when reallocating, not 1.

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