]> 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@enc.com.au>
Sun, 25 Aug 2019 00:35:50 +0000 (10:35 +1000)
commitd37f85c269fbb6e905802ffdbce0ba4173ba21a9
tree1273f38a7cbe3d102c05a777690db9f4c6dd8c7c
parentdd95e865de3193a7732c2b54870f2ff8b214e516
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