From 1f45878a72f23d4bae08d73b614096b485f35274 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 4 Nov 2016 13:45:30 +0100 Subject: [PATCH] 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 --- 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 0e31dc55c..44dd16559 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;