]> granicus.if.org Git - procps-ng/commit
top: fix additional SEGVs if no tasks were displayable
authorJim Warner <james.warner@comcast.net>
Sun, 13 Sep 2020 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Wed, 16 Sep 2020 04:27:31 +0000 (14:27 +1000)
commit6e1715d9ebcffd7a673cbacbca4416c42d103c7b
treec0c1285cbf2cec0299275f88cc440d9adc87ef3d
parentf57a0301e3adfa5fd456404a200182c7f21da03a
top: fix additional SEGVs if no tasks were displayable

This patch is an outgrowth of that commit shown below.

Many additional potential segmentation faults might be
encountered if interactive commands are opened up to a
user when a '-p' switch has a single non-existent pid.

[ always the 'k', 'L', 'r', 'Y' keys & maybe 'v' too ]

So, this patch will restrict such a loser (oops, user)
to a reduced subset of normal commands until he/she/it
quits then restarts top with something to be displayed
or issues the '=' command overriding that '-p' switch.

Reference(s):
commit f57a0301e3adfa5fd456404a200182c7f21da03a

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c