Skip to content
Snippets Groups Projects
Commit c952b715 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Gerd Hoffmann
Browse files

gtk: avoid oob array access


When too many consoles are created, vcs[] may be write out-of-bounds.

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20161207105511.25173-1-marcandre.lureau@redhat.com
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 6250dff3
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment