SHA256
1
0
forked from pool/qemu
qemu/vgabios-Make-sure-stdvga_list_modes-doesn-t-overrun-.patch
Bruce Rogers fb067ac4a4 Accepting request 236077 from home:bfrogers:branches:Virtualization
Fix problem discovered with direct kernel boot for SLES 10 and SLES 11 guests (bnc#880625)
Only build x86 firmware on x86, to avoid randomly getting the upstream binary firmware blobs packaged, instead of the ones we try to build.
Add probing of vhost-net for SLE11 host in udev rules file.
Get rid of pmtools Buildrequires for old distros - I checked, we can't build the firmware as is for old distros correctly.

OBS-URL: https://build.opensuse.org/request/show/236077
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=213
2014-06-02 18:08:59 +00:00

30 lines
986 B
Diff

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