]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virStorageFileGetMetadataRecurse: Expect NULL src->path
authorPeter Krempa <pkrempa@redhat.com>
Mon, 17 Feb 2020 11:27:41 +0000 (12:27 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Feb 2020 06:57:08 +0000 (07:57 +0100)
The path can be NULL e.g. for NBD disks. Use NULLSTR to prevent use of
NULL in %s.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/util/virstoragefile.c

index f8e41025883d488aca4e10d848d263ef149a615b..cf37744d6f2b217e8e806c8f836b2cd9e903a300 100644 (file)
@@ -4973,7 +4973,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
     g_autoptr(virStorageSource) backingStore = NULL;
 
     VIR_DEBUG("path=%s format=%d uid=%u gid=%u",
-              src->path, src->format,
+              NULLSTR(src->path), src->format,
               (unsigned int)uid, (unsigned int)gid);
 
     /* exit if we can't load information about the current image */
@@ -4995,7 +4995,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
     if (virHashLookup(cycle, uniqueName)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("backing store for %s (%s) is self-referential"),
-                       src->path, uniqueName);
+                       NULLSTR(src->path), uniqueName);
         goto cleanup;
     }