From: Jim Warner Date: Wed, 11 Apr 2012 09:11:12 +0000 (-0500) Subject: top: fix a segfault when -p switch specified invalid pid X-Git-Tag: v3.3.3~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd253e0dc6ee899cc3ec74c72dc032b7c89f65b3;p=procps-ng top: fix a segfault when -p switch specified invalid pid In attempting to keep at least one task visible when scrolling vertically, a negative task index would be produced when pid monitoring was in effect and no matching pid was found. Since there were already other conditions where no task might displayed, the faulty source line has been removed. Bug-Debian: http://bugs.debian.org/668335 Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 65498a13..c081af35 100644 --- a/top/top.c +++ b/top/top.c @@ -3774,7 +3774,6 @@ static int window_show (WIN_t *q, int wmax) { } i = q->begtask; - if (i >= Frame_maxtask) i = q->begtask = Frame_maxtask - 1; lwin = 1; // 1 for the column header wmax = winMIN(wmax, q->winlines + 1); // ditto for winlines, too