]> git.ipfire.org Git - thirdparty/libvirt.git/commit
command: handle empty buffer argument correctly
authorEric Blake <eblake@redhat.com>
Thu, 10 Nov 2011 00:19:33 +0000 (17:19 -0700)
committerEric Blake <eblake@redhat.com>
Sat, 3 Dec 2011 22:55:46 +0000 (15:55 -0700)
commit2b045d39df74dd21dbb043f5bb2d97d9299a031e
tree74c7ee476fdcd45e7c57f93a5d8e7c838d44665f
parentc74a2a03f025169e8d6c3e5ddc970963c1c76418
command: handle empty buffer argument correctly

virBufferContentAndReset (intentionally) returns NULL for a buffer
with no content, but it is feasible to invoke a command with an
explicit empty string.

* src/util/command.c (virCommandAddEnvBuffer): Reject empty string.
(virCommandAddArgBuffer): Allow explicit empty argument.
* tests/commandtest.c (test9): Test it.
* tests/commanddata/test9.log: Adjust.
src/util/command.c
tests/commanddata/test9.log
tests/commandtest.c