gtk: avoid oob array access
PATCH 1/1 gtk: avoid oob array access
When too many consoles are created, vcs[] may be write out-of-bounds.
Signed-off-by Marc-André Lureau <[email protected]>
--- ui/gtk.c | 5 +++++ 1 file changed, 5 insertions(+)
ui/gtk.c +5 -0
@@ -1696,6 +1696,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 ;
Signature · 1 line
2.11.0
Quoted 13 lines · Marc-André Lureau
When too many consoles are created, vcs[] may be write out-of-bounds.
Signed-off-by Marc-André Lureau <[email protected]>--- ui/gtk.c | 5 +++++ 1 file changed, 5 insertions(+)ui/gtk.c +0
-0@@ -1696,6 +1696,11 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)ChardevCommon *common =qapi_ChardevVC_base (vc);
ui/gtk.c static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp) · line 1706
Quoted 10 lines
ui/gtk.c +5
-0CharDriverState *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 ;
added to ui queue.
thanks,
Gerd