1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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@g10code.com>
This commit is contained in:
Justus Winter 2016-11-04 13:45:30 +01:00
parent 43f8006f5c
commit 1f45878a72

View File

@ -2041,7 +2041,9 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) {
} }
} else if (is_string(l)) { } else if (is_string(l)) {
if (!f) { if (!f) {
p = strvalue(l); *pp = strvalue(l);
*plen = strlength(l);
return;
} else { /* Hack, uses the fact that printing is needed */ } else { /* Hack, uses the fact that printing is needed */
*pp=sc->strbuff; *pp=sc->strbuff;
*plen=0; *plen=0;