mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +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)
|
if (VIR_ALLOC(vcpupin) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
|
if (!(vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN)))
|
||||||
|
goto error;
|
||||||
virBitmapCopy(vcpupin->cpumask, def->cpumask);
|
virBitmapCopy(vcpupin->cpumask, def->cpumask);
|
||||||
vcpupin->vcpuid = i;
|
vcpupin->vcpuid = i;
|
||||||
def->cputune.vcpupin[def->cputune.nvcpupin++] = vcpupin;
|
def->cputune.vcpupin[def->cputune.nvcpupin++] = vcpupin;
|
||||||
|
Loading…
Reference in New Issue
Block a user