From e6e56adf208f194ecafda29bb1c1c06655348432 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 23 Jun 2016 14:10:00 +0200 Subject: [PATCH] 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 --- tests/gpgscm/scheme.c | 3 +++ 1 file changed, 3 insertions(+) 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;