scd: Fix length error for READKEY.

* scd/app-openpgp.c (do_readkey): Decrement the length.

--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2016-11-04 15:34:35 +09:00
parent f9da935c3e
commit cd00b07ec2
1 changed files with 2 additions and 0 deletions

View File

@ -1770,6 +1770,8 @@ do_readkey (app_t app, int advanced, const char *keyid,
gcry_sexp_sprint (s_key, GCRYSEXP_FMT_ADVANCED, *pk, *pklen);
gcry_sexp_release (s_key);
/* Decrement for trailing '\0' */
*pklen = *pklen - 1;
}
else
{