diff options
author | Katsuhiro Ueno <[email protected]> | 2018-02-07 09:52:37 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-02-14 16:11:17 +0000 |
commit | df97fe24807826ddc2af0e45e416fb81c5666f88 (patch) | |
tree | b3f3d6592938d89d80cf224207618daaaa4b4c4f | |
parent | sm: Fix minor memory leak in --export-p12. (diff) | |
download | gnupg-df97fe24807826ddc2af0e45e416fb81c5666f88.tar.gz gnupg-df97fe24807826ddc2af0e45e416fb81c5666f88.zip |
agent: Avoid appending a '\0' byte to the response of READKEY
* agent/command.c (cmd_readkey): Set pkbuflen to the length of the output
without an extra '\0' byte.
-rw-r--r-- | agent/command.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/command.c b/agent/command.c index 3a547ffaa..f9bc6ca96 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1031,7 +1031,8 @@ cmd_readkey (assuan_context_t ctx, char *line) rc = gpg_error_from_syserror (); else { - gcry_sexp_sprint (s_pkey, GCRYSEXP_FMT_CANON, pkbuf, pkbuflen); + pkbuflen = gcry_sexp_sprint (s_pkey, GCRYSEXP_FMT_CANON, + pkbuf, pkbuflen); rc = assuan_send_data (ctx, pkbuf, pkbuflen); } } |