gpgscm: Fix printing strings containing zero bytes.
authorJustus Winter <justus@g10code.com>
Fri, 4 Nov 2016 12:45:30 +0000 (13:45 +0100)
committerJustus Winter <justus@g10code.com>
Fri, 4 Nov 2016 12:45:30 +0000 (13:45 +0100)
* tests/gpgscm/scheme.c (atom2str): Fix computing the length of Scheme
strings.  Scheme strings can contain zero bytes.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/scheme.c

index 0e31dc5..44dd165 100644 (file)
@@ -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;