mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
util: storagefile: Don't pursue backing chain of NULL image
When virStorageFileGetMetadata is called with NULL path argument, the invalid pointer boils down through the recursive worker and is caught by virHashAddEntry which is thankfully resistant to NULL arguments. As it doesn't make sense to pursue backing chains of NULL volumes, exit earlier. This was noticed in the virt-aahelper-test with a slightly modified codebase.
This commit is contained in:
parent
ce5ec2f1da
commit
6c312b0d1e
@ -1118,7 +1118,7 @@ virStorageFileGetMetadata(const char *path, int format,
|
||||
virHashTablePtr cycle = virHashCreate(5, NULL);
|
||||
virStorageFileMetadataPtr ret;
|
||||
|
||||
if (!cycle)
|
||||
if (!cycle || !path)
|
||||
return NULL;
|
||||
|
||||
if (format <= VIR_STORAGE_FILE_NONE)
|
||||
|
Loading…
Reference in New Issue
Block a user