提交 182d5ed3 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 a50de5d8
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册