diff --git a/NEWS b/NEWS index eacc1d5e..d616162c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ procps-ng NEXT * top: add command line 'e' for symmetry with 'E' issue #165 * top: add '4' toggle for two abreast cpu display issue #172 * top: add '!' toggle for combining multiple cpus + * top: fix potential SEGV involving -p switch merge #114 * vmstat: Wide mode gives wider proc columns merge #48 * watch: Add environment variable for interval merge #62 diff --git a/top/top.c b/top/top.c index fb06c2ad..7732adfd 100644 --- a/top/top.c +++ b/top/top.c @@ -6045,6 +6045,8 @@ static int window_show (WIN_t *q, int wmax) { // Display Column Headings -- and distract 'em while we sort (maybe) PUFF("\n%s%s%s", q->capclr_hdr, q->columnhdr, Caps_endline); + // and just in case 'Monpids' is active but matched no processes ... + if (!PIDSmaxt) return 1; // 1 for the column header if (CHKw(q, Show_FOREST)) forest_begin(q);