diff options
author | Werner Koch <[email protected]> | 2014-09-18 14:00:34 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-09-18 14:01:05 +0000 |
commit | 6e7bcabd781a3ca9ad7dd90d962fb2a239feab4a (patch) | |
tree | 689d877081b7c3bd9901535dd5b576fa0a32a47f | |
parent | scd: Fix int/short mismatch in format string of app-p15.c (diff) | |
download | gnupg-6e7bcabd781a3ca9ad7dd90d962fb2a239feab4a.tar.gz gnupg-6e7bcabd781a3ca9ad7dd90d962fb2a239feab4a.zip |
g13: Avoid segv after pipe creation failure.
* g13/call-gpg.c (gpg_encrypt_blob): Init some vars in case of an
early error.
(gpg_decrypt_blob): Ditto.
Diffstat (limited to '')
-rw-r--r-- | g13/call-gpg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/g13/call-gpg.c b/g13/call-gpg.c index 316082a72..54f6056d5 100644 --- a/g13/call-gpg.c +++ b/g13/call-gpg.c @@ -332,11 +332,11 @@ gpg_encrypt_blob (ctrl_t ctrl, const void *plain, size_t plainlen, strlist_t keys, void **r_ciph, size_t *r_ciphlen) { gpg_error_t err; - assuan_context_t ctx; + assuan_context_t ctx = NULL; int outbound_fds[2] = { -1, -1 }; int inbound_fds[2] = { -1, -1 }; - npth_t writer_thread; - npth_t reader_thread; + npth_t writer_thread = (npth_t)0; + npth_t reader_thread = (npth_t)0; gpg_error_t writer_err, reader_err; membuf_t reader_mb; char line[ASSUAN_LINELENGTH]; @@ -475,11 +475,11 @@ gpg_decrypt_blob (ctrl_t ctrl, const void *ciph, size_t ciphlen, void **r_plain, size_t *r_plainlen) { gpg_error_t err; - assuan_context_t ctx; + assuan_context_t ctx = NULL; int outbound_fds[2] = { -1, -1 }; int inbound_fds[2] = { -1, -1 }; - npth_t writer_thread; - npth_t reader_thread; + npth_t writer_thread = (npth_t)0; + npth_t reader_thread = (npth_t)0; gpg_error_t writer_err, reader_err; membuf_t reader_mb; int ret; |