util: storagefile: Tolerate NULL path when looking up volume in chain

chain->path may be NULL e.g. for NBD drives, so the check needs to avoid
dereferencing the path in such case
This commit is contained in:
Peter Krempa 2017-10-12 19:26:10 +02:00
parent 9cc8d6ee9e
commit e3fb414e77

View File

@ -1610,7 +1610,7 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
break;
} else {
if (STREQ_NULLABLE(name, chain->relPath) ||
STREQ(name, chain->path))
STREQ_NULLABLE(name, chain->path))
break;
if (nameIsFile && virStorageSourceIsLocalStorage(chain)) {