diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-02-11 17:36:56 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-02-11 17:46:54 -0500 |
commit | 2620984b42fd2a374e94c75f04982c60edf179cb (patch) | |
tree | 9ad25df5b1d54cc0fe0554f070e32d137e069c87 /vgasrc/stdvgamodes.c | |
parent | 0910ddeb04f050b8800f60c8a4d2757f9cbeeb8d (diff) | |
download | seabios-2620984b42fd2a374e94c75f04982c60edf179cb.tar.gz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vgasrc/stdvgamodes.c b/vgasrc/stdvgamodes.c index a97c85fe..84367292 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) |