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

Jordan Crouse jordan.crouse at amd.com
Wed Sep 24 16:19:34 CEST 2008


On 23/09/08 22:34 +0200, Ulf Jordan wrote:
> The attached patch fixes an off-by-one issue in the allocation of stdscr, 
> which lead to alignment and data corruption issues.
> 
> /ulf

> 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>
Acked-by: Jordan Crouse <jordan.crouse at amd.com>

r3598.  Thank you.

> 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?
>  
>  	werase(stdscr);

> --
> coreboot mailing list: coreboot at coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot


-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.





More information about the coreboot mailing list