aboutsummaryrefslogtreecommitdiff
path: root/vgasrc/stdvgamodes.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-02-11 17:36:56 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-02-11 17:46:54 -0500
commit2620984b42fd2a374e94c75f04982c60edf179cb (patch)
tree9ad25df5b1d54cc0fe0554f070e32d137e069c87 /vgasrc/stdvgamodes.c
parent0910ddeb04f050b8800f60c8a4d2757f9cbeeb8d (diff)
downloadseabios-2620984b42fd2a374e94c75f04982c60edf179cb.zip
seabios-2620984b42fd2a374e94c75f04982c60edf179cb.tar.gz
seabios-2620984b42fd2a374e94c75f04982c60edf179cb.tar.bz2
vgabios: Make sure stdvga_list_modes() doesn't overrun the buffer.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/stdvgamodes.c')
-rw-r--r--vgasrc/stdvgamodes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vgasrc/stdvgamodes.c b/vgasrc/stdvgamodes.c
index a97c85f..8436729 100644
--- a/vgasrc/stdvgamodes.c
+++ b/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)