]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: storagefile: Tolerate NULL path when looking up volume in chain
authorPeter Krempa <pkrempa@redhat.com>
Thu, 12 Oct 2017 17:26:10 +0000 (19:26 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Oct 2017 04:19:18 +0000 (06:19 +0200)
chain->path may be NULL e.g. for NBD drives, so the check needs to avoid
dereferencing the path in such case

src/util/virstoragefile.c

index 59aca2c397d1ea15937452cb4303e04fdfa6972f..a9d8e59405f3df8456a87b3c4261b21a2a0f9538 100644 (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)) {