提交 03619176 编写于 作者: J Ján Tomko 提交者: Osier Yang

conf: snapshot: check return value of virDomainSnapshotObjListNum

If it's negative, this might result in a request to allocate lots of
memory.
上级 34e57913
......@@ -1026,7 +1026,7 @@ virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
int ret = -1;
int i;
if (!snaps)
if (!snaps || count < 0)
return count;
if (VIR_ALLOC_N(names, count) < 0 ||
VIR_ALLOC_N(list, count + 1) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册