提交 c952b715 编写于 作者: M Marc-André Lureau 提交者: Gerd Hoffmann

gtk: avoid oob array access

When too many consoles are created, vcs[] may be write out-of-bounds.
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20161207105511.25173-1-marcandre.lureau@redhat.com
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 6250dff3
......@@ -1706,6 +1706,11 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
ChardevCommon *common = qapi_ChardevVC_base(vc);
CharDriverState *chr;
if (nb_vcs == MAX_VCS) {
error_setg(errp, "Maximum number of consoles reached");
return NULL;
}
chr = qemu_chr_alloc(common, errp);
if (!chr) {
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册