提交 1a5512bb 编写于 作者: G Gonglei 提交者: Paolo Bonzini

spapr: fix possible Negative array index read

fix CID 1351391.
Signed-off-by: NGonglei <arei.gonglei@huawei.com>
Message-Id: <1456998223-12356-6-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 dacca04c
...@@ -2208,6 +2208,10 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, ...@@ -2208,6 +2208,10 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,
if (*errp) { if (*errp) {
return; return;
} }
if (node < 0 || node >= MAX_NODES) {
error_setg(errp, "Invaild node %d", node);
return;
}
/* /*
* Currently PowerPC kernel doesn't allow hot-adding memory to * Currently PowerPC kernel doesn't allow hot-adding memory to
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册