diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-01-10 13:45:28 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-01-10 13:49:08 +0300 |
commit | a4584410fc24486eae272c6e6a582eb27757314c (patch) | |
tree | a813b7af3f4820a1d3d3620118ee4e29eff3c05d /winsup/cygwin/sigproc.cc | |
parent | 8fe5b333b311ceb1f7576b2835c4ffc475f5fc69 (diff) |
Cygwin: /proc/<PID>/status: avoid crash computing signal info
The code computing the mask of pending signals used the per-queued
signal TLS pointer without checking it for NULL. Fix this by using
the process-wide signal mask in that case.
Fixes: 195169186bfd5 ("Cygwin: wait_sig: allow to compute process-wide mask of pending signals")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index a99876dc9..fd3291c1b 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1382,7 +1382,8 @@ wait_sig (VOID *) *pack.mask = 0; while ((q = q->next)) { - if (q->sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo))) + _cygtls *sigtls = q->sigtls ?: _main_tls; + if (sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo))) { tl_entry = cygheap->find_tls (q->si.si_signo, issig_wait); if (tl_entry) |