aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-06-23 12:10:00 +0000
committerJustus Winter <[email protected]>2016-06-23 12:18:20 +0000
commite6e56adf208f194ecafda29bb1c1c06655348432 (patch)
tree3a1d551c80207d31971cca02b6b0f39230d93cb9
parentgpgscm: Fix manual. (diff)
downloadgnupg-e6e56adf208f194ecafda29bb1c1c06655348432.tar.gz
gnupg-e6e56adf208f194ecafda29bb1c1c06655348432.zip
gpgscm: Fix Scheme initialization.
This potentially causes a crash if the garbage collector marks an eof object. * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize 'EOF_OBJ'. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--tests/gpgscm/scheme.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 3c7910c15..3ed5d9bf2 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -4778,6 +4778,9 @@ int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) {
/* init F */
typeflag(sc->F) = (T_ATOM | MARK);
car(sc->F) = cdr(sc->F) = sc->F;
+ /* init EOF_OBJ */
+ typeflag(sc->EOF_OBJ) = (T_ATOM | MARK);
+ car(sc->EOF_OBJ) = cdr(sc->EOF_OBJ) = sc->EOF_OBJ;
/* init sink */
typeflag(sc->sink) = (T_PAIR | MARK);
car(sc->sink) = sc->NIL;