From 8180d1a22f54f2a792c9187d98d15b2501d35aa7 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 29 Dec 2014 19:57:14 +0100 Subject: libpayload/PDcurses: avoid NULL deref Change-Id: I86f1c97858fa3d007c4d4509fac3473c9e2ad2f2 Signed-off-by: Patrick Georgi Found-by: Coverity Scan Reviewed-on: http://review.coreboot.org/7973 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Edward O'Callaghan --- payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'payloads') diff --git a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c index 0128df5cb8..75426e2728 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c +++ b/payloads/libpayload/curses/PDCurses-3.4/pdcurses/clear.c @@ -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) -- cgit v1.2.3