gpgscm: Improve syntax checking.
authorJustus Winter <justus@g10code.com>
Thu, 20 Apr 2017 13:09:13 +0000 (15:09 +0200)
committerJustus Winter <justus@g10code.com>
Mon, 24 Apr 2017 13:47:27 +0000 (15:47 +0200)
* tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are
symbols.

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

index 11f6fcb..38f2870 100644 (file)
@@ -3559,10 +3559,13 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
                     is_pair(x); x = cdr(x), y = cdr(y)) {
                     if (y == sc->NIL) {
                          Error_1(sc, "not enough arguments, missing:", x);
-                    } else {
+                    } else if (is_symbol(car(x))) {
                          new_slot_in_env(sc, car(x), car(y));
-                    }
+                    } else {
+                        Error_1(sc, "syntax error in closure: not a symbol", car(x));
+                   }
                }
+
                if (x == sc->NIL) {
                     if (y != sc->NIL) {
                       Error_0(sc, "too many arguments");