From 13a5277c238c33ef572aef53377bdae1f921330f Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Mon, 12 Oct 1998 16:32:32 +0000 Subject: Fix a curses bug exposed by the ":numbers" display of systat -iostat. This bug showed up when you had more than 3 devices displayed. (thus requiring a second line of display) Here's a quote From the PR: When wrefresh() is called with a subwindow as argument, __set_subwin might be called with reversed arguments if wrefresh() decides to calls quickch(). This may cause use of negative array indexes, with a resulting segfault. Since quickch() manipulates the line structures belonging to curscr, it looks like all subwindows of curscr should be updated. PR: bin/8086 Submitted by: Tor Egge --- lib/libcurses/refresh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c index 1719454b3650..14e2aca9cdd6 100644 --- a/lib/libcurses/refresh.c +++ b/lib/libcurses/refresh.c @@ -682,8 +682,8 @@ quickch(win) * Need to repoint any subwindow lines to the rotated * line structured. */ - for (wp = win->nextp; wp != win; wp = wp->nextp) - __set_subwin(win, wp); + for (wp = curscr->nextp; wp != curscr; wp = wp->nextp) + __set_subwin(wp->orig, wp); } } -- cgit v1.3