1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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.
This commit is contained in:
Katsuhiro Ueno 2018-02-07 18:52:37 +09:00 committed by Werner Koch
parent 80719612b7
commit df97fe2480
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -1031,7 +1031,8 @@ cmd_readkey (assuan_context_t ctx, char *line)
rc = gpg_error_from_syserror (); rc = gpg_error_from_syserror ();
else 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); rc = assuan_send_data (ctx, pkbuf, pkbuflen);
} }
} }