diff options
author | Werner Koch <wk@gnupg.org> | 2018-05-01 19:35:28 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2018-05-01 19:45:00 +0200 |
commit | b26a227173e8e9b91be14f06ee781c6e214e50ff (patch) | |
tree | eb9f552c1897748f2dd370b61157ae0fd71ea215 /src/init.c | |
parent | 7e2517a29619c35257b38aa137b6772e471d7e4e (diff) | |
download | libgpg-error-b26a227173e8e9b91be14f06ee781c6e214e50ff.tar.gz |
core,w32: Avoid recursive use of npth_unprotect.
* src/w32-estream.c (reader): Use standard free.
(writer): Ditto.
--
There are two errors: The minor one is that we allocated with calloc
but released with _gpgrt_free. The major one is the recursive use of
npth_unprotect due to the syscall_clamp mechanism:
1. Around the call to _gpgrt_w32_poll
2. By gpgrt_lock_lock on behalf of a the custom allocation handler in
the worker threads at their _gpgrt_free.
This problem was exhibited by GnuPG's dirmngr component.
GnuPG-bug-id: 3937
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/init.c')
-rw-r--r-- | src/init.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -300,7 +300,11 @@ _gpg_err_set_errno (int err) /* Internal tracing functions. Except for TRACE_FP we use flockfile - * and funlockfile to protect their use. */ + * and funlockfile to protect their use. + * + * Warning: Take care with the trace functions - they may not use any + * of our services, in particular not the syscall clamp mechanism for + * reasons explained in w32-stream.c:create_reader. */ static FILE *trace_fp; static int trace_save_errno; static int trace_with_errno; |