mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Fix crash on OOM in parsing CPU mask in domain XML
The virDomainDefParseXML method did not check the return value of the virBitmapNew API call for NULL. This lead to a crash on OOM Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
a50de5d827
commit
182d5ed331
@ -11188,7 +11188,8 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
if (VIR_ALLOC(vcpupin) < 0)
|
||||
goto error;
|
||||
|
||||
vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
|
||||
if (!(vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN)))
|
||||
goto error;
|
||||
virBitmapCopy(vcpupin->cpumask, def->cpumask);
|
||||
vcpupin->vcpuid = i;
|
||||
def->cputune.vcpupin[def->cputune.nvcpupin++] = vcpupin;
|
||||
|
Loading…
x
Reference in New Issue
Block a user