]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: storagefile: Don't crash on gluster URIs without path
authorPeter Krempa <pkrempa@redhat.com>
Thu, 26 Feb 2015 09:28:21 +0000 (10:28 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 26 Feb 2015 10:50:38 +0000 (11:50 +0100)
commitfc56ecd73520d3a3680d6f7500944298a99f254d
tree9b397b9cc1f1a5af7336d5e7450ac5157fd0847c
parentb15b21f3a52945644c7ccbbe1dd51b86d36ca777
util: storagefile: Don't crash on gluster URIs without path

Similar to commit fdb80ed4f6563928b9942a0d1450e0c725aa6c06 libvirtd
would crash if a gluster URI without path would be used in the backing
chain of a volume. The crash happens in the gluster specific part of the
parser that extracts the gluster volume name from the path.

Fix the crash by checking that the PATH is NULL.

This patch does not contain a test case as it's not possible to test it
with the current infrastructure as the test suite would attempt to
contact the gluster server in the URI. I'm working on the test suite
addition but that will be post-release material.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1196528
src/util/virstoragefile.c