[coreboot] [PATCH] libpayload: fix off-by-one in stdscr

Ulf Jordan jordan at chalmers.se
Tue Sep 23 22:34:59 CEST 2008

The attached patch fixes an off-by-one issue in the allocation of stdscr, 
which lead to alignment and data corruption issues.

-------------- next part --------------
Adjust width of stdscr to exactly SCREEN_X. This fixes alignment issues due
to an extra space sent at end of each line, as well as a data corruption
issue, which could result in undefined color pairs being referenced.

Signed-off-by: Ulf Jordan <jordan at chalmers.se>

Index: libpayload/curses/tinycurses.c
--- libpayload/curses/tinycurses.c	(revision 3590)
+++ libpayload/curses/tinycurses.c	(arbetskopia)
@@ -314,7 +314,7 @@
 	// Speaker init?
-	stdscr = newwin(SCREEN_Y, SCREEN_X + 1, 0, 0);
+	stdscr = newwin(SCREEN_Y, SCREEN_X, 0, 0);
 	// TODO: curscr, newscr?

More information about the coreboot mailing list