[PATCH] storage: fix crash when listing volumes or undefining a pool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/storage/storage_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index aaa0f02..85fc0f2 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -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;
         }
     }
-- 
1.8.5.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]