[Pkg-gnupg-commit] [gnupg2] 205/292: scd: Fix length error for READKEY.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit cd00b07ec26c3408e6aee66957b08c6fd319b700
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Nov 4 15:34:35 2016 +0900

    scd: Fix length error for READKEY.
    
    * scd/app-openpgp.c (do_readkey): Decrement the length.
    
    --
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 scd/app-openpgp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 4bf99ad..f8d9954 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -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
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list