[Pkg-gnupg-commit] [gnupg2] 207/292: gpgscm: Fix printing strings containing zero bytes.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Nov 21 06:31:43 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 1f45878a72f23d4bae08d73b614096b485f35274
Author: Justus Winter <justus at g10code.com>
Date: Fri Nov 4 13:45:30 2016 +0100
gpgscm: Fix printing strings containing zero bytes.
* tests/gpgscm/scheme.c (atom2str): Fix computing the length of Scheme
strings. Scheme strings can contain zero bytes.
Signed-off-by: Justus Winter <justus at g10code.com>
---
tests/gpgscm/scheme.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 0e31dc5..44dd165 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -2041,7 +2041,9 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) {
}
} else if (is_string(l)) {
if (!f) {
- p = strvalue(l);
+ *pp = strvalue(l);
+ *plen = strlength(l);
+ return;
} else { /* Hack, uses the fact that printing is needed */
*pp=sc->strbuff;
*plen=0;
--
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