[PATCH] vgabios: Make sure stdvga_list_modes() doesn't overrun the buffer.
Feb. 12, 2014
3:42 p.m.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> --- vgasrc/stdvgamodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 1.8.5.3
4297
Age (days ago)
4297
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kevin O'Connor