Add a check in the compilation-top reader.

This bug was found by fuzz testing.
This commit is contained in:
Sam Tobin-Hochstadt 2015-10-13 17:48:03 -04:00
parent f63188b4ea
commit f400dab912

View File

@ -338,6 +338,7 @@ static Scheme_Object *read_top(Scheme_Object *obj)
top->iso.so.type = scheme_compilation_top_type;
if (!SCHEME_PAIRP(obj)) return NULL;
top->max_let_depth = SCHEME_INT_VAL(SCHEME_CAR(obj));
if (top->max_let_depth < 0) return NULL; /* Should this check for a max as well? */
obj = SCHEME_CDR(obj);
if (!SCHEME_PAIRP(obj)) return NULL;
top->binding_namess = SCHEME_CAR(obj); /* checking is in scheme_install_binding_names() */