mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: snapshot: check return value of virDomainSnapshotObjListNum
If it's negative, this might result in a request to allocate lots of memory.
This commit is contained in:
parent
34e5791332
commit
0361917619
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user