aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-06-04 04:39:46 +0000
committerNIIBE Yutaka <[email protected]>2019-06-04 04:39:46 +0000
commit537fbe13af6a70e105982c4b69c1bcc3908ffb08 (patch)
tree0f66ef746cdf06f62a5b0b7f256a2da53c31dda9
parentagent: Allow TERM="". (diff)
downloadgnupg-537fbe13af6a70e105982c4b69c1bcc3908ffb08.tar.gz
gnupg-537fbe13af6a70e105982c4b69c1bcc3908ffb08.zip
g10: Block signals in g10_exit.
* g10/gpg.c (g10_exit): Block all signals before calling emergency_cleanup. -- There is a race condition here which results crash of the process. When a signal is delivered in emergency_cleanup, it is called again. This change fixes the problem. GnuPG-bug-id: 2747 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--g10/gpg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index b46d22690..1819c3fe8 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -5231,6 +5231,7 @@ g10_exit( int rc )
if (opt.debug)
gcry_control (GCRYCTL_DUMP_SECMEM_STATS );
+ gnupg_block_all_signals ();
emergency_cleanup ();
rc = rc? rc : log_get_errorcount(0)? 2 : g10_errors_seen? 1 : 0;