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:
parent
43f8006f5c
commit
1f45878a72
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user