]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: require command args to be non-NULL
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 17 Dec 2018 13:18:31 +0000 (13:18 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 17 Dec 2018 14:43:33 +0000 (14:43 +0000)
commit912c6b22fc622cd7c7d29c7f8eaeb816b266daac
tree3e9fca6c1f795ed712cf5bbc4f6635f90822fa2d
parentf8f525ff86e5458701289e6bdd9eea1f7875de57
util: require command args to be non-NULL

The virCommand APIs do not expect to be given a NULL value for an arg
name or value. Such a mistake can lead to execution of the wrong
command, as the NULL may prematurely terminate the list of args.
Detect this and report suitable error messages.

This identified a flaw in the storage test which was passing a NULL
instead of the volume path. This flaw was then validated by an incorrect
set of qemu-img args as expected data.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/vircommand.c
tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml