libpayload/PDcurses: avoid NULL deref

Change-Id: I86f1c97858fa3d007c4d4509fac3473c9e2ad2f2
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Found-by: Coverity Scan
Reviewed-on: http://review.coreboot.org/7973
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
Patrick Georgi 2014-12-29 19:57:14 +01:00 committed by Patrick Georgi
parent dafa12adfc
commit 8180d1a22f
1 changed files with 3 additions and 3 deletions

View File

@ -86,14 +86,14 @@ int clrtoeol(void)
int wclrtobot(WINDOW *win)
{
int savey = win->_cury;
int savex = win->_curx;
PDC_LOG(("wclrtobot() - called\n"));
if (!win)
return ERR;
int savey = win->_cury;
int savex = win->_curx;
/* should this involve scrolling region somehow ? */
if (win->_cury + 1 < win->_maxy)