libpayload/PDcurses: avoid NULL deref

Found by Coverity Scan

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/7973
This commit is contained in:
Stefan Reinauer
2015-11-10 19:19:00 +01:00
committed by William McBrine
parent 060c80a90b
commit 5325c5da24

View File

@@ -84,14 +84,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)