提交 2a6395aa 编写于 作者: M Martin Kletzander

storage: fix crash when listing volumes or undefining a pool

The commit cad3cf9a 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: NMartin Kletzander <mkletzan@redhat.com>
上级 4f588a1b
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册