mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
gtk: avoid oob array access
When too many consoles are created, vcs[] may be write out-of-bounds. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20161207105511.25173-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
6250dff39a
commit
c952b71582
1 changed files with 5 additions and 0 deletions
5
ui/gtk.c
5
ui/gtk.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue