mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
storage: fix crash when listing volumes or undefining a pool
The commit cad3cf9a951d26da9d2ee0f5b52fb1a2dbb74af1 introduced a crash due to wrong order of parameters being passed to the function. When deleting an element, the function decreased the iterator instead of count and if listing volumes after that (or undefining the pool, NULL was being dereferenced. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
4f588a1b46
commit
2a6395aa1d
@ -1566,7 +1566,7 @@ storageVolDelete(virStorageVolPtr obj,
|
||||
vol->name, pool->def->name);
|
||||
virStorageVolDefFree(vol);
|
||||
|
||||
VIR_DELETE_ELEMENT(pool->volumes.objs, pool->volumes.count, i);
|
||||
VIR_DELETE_ELEMENT(pool->volumes.objs, i, pool->volumes.count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user