SHA256
1
0
forked from pool/qemu
qemu/vgabios-Make-sure-stdvga_list_modes-doesn-t-overrun-.patch

30 lines
986 B
Diff
Raw Normal View History

From 2620984b42fd2a374e94c75f04982c60edf179cb Mon Sep 17 00:00:00 2001
From: Kevin O'Connor <kevin@koconnor.net>
Date: Tue, 11 Feb 2014 17:36:56 -0500
Subject: [PATCH] vgabios: Make sure stdvga_list_modes() doesn't overrun the
buffer.
References: bnc#880625
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
vgasrc/stdvgamodes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/seabios/vgasrc/stdvgamodes.c b/roms/seabios/vgasrc/stdvgamodes.c
index a97c85f..8436729 100644
--- a/roms/seabios/vgasrc/stdvgamodes.c
+++ b/roms/seabios/vgasrc/stdvgamodes.c
@@ -336,7 +336,7 @@ void
stdvga_list_modes(u16 seg, u16 *dest, u16 *last)
{
int i;
- for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
+ for (i = 0; i < ARRAY_SIZE(vga_modes) && dest < last; i++) {
struct stdvga_mode_s *stdmode_g = &vga_modes[i];
u16 mode = GET_GLOBAL(stdmode_g->mode);
if (mode == 0xffff)
--
1.9.0