]> granicus.if.org Git - procps-ng/commit
top: avoid a potential SEGV during program termination
authorJim Warner <james.warner@comcast.net>
Tue, 6 Aug 2019 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sat, 21 Sep 2019 21:32:03 +0000 (07:32 +1000)
commit90c22e64ffc52e01ea2c9b81680d4b4a37f2d8c4
treec1d6b638e33fb05f208fd4be423a27e21e911915
parent33cd2ccf871867751b1339aeb972d3db08effb35
top: avoid a potential SEGV during program termination

The backtrace shown in the bug report referenced below
illustrates a 'normal' program termination interrupted
with some signal, ultimately then causing a top crash.

So this commit just rearranges a little code such that
all signals will be blocked during that rather lengthy
end of program processing regardless of how initiated.

[ in that report, ignore the assertion regarding the ]
[ '-n' option. it obviously was not '1' since do_key ]
[ had been called, which otherwise wouldn't be true. ]

[ and when it is '1' the -d option would be ignored. ]

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1737552

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