Bug 738952 - Invalid syntax for (cond) causes a segfault

Segfault in script-fu, spotted by Pedro Gimeno.
This commit is contained in:
Simon Budig 2015-05-04 20:03:02 +02:00
parent ebb66ea569
commit b6946af0e1
1 changed files with 3 additions and 0 deletions

View File

@ -3144,6 +3144,9 @@ static pointer opexe_1(scheme *sc, enum scheme_opcodes op) {
if ((sc->code = cdar(sc->code)) == sc->NIL) {
s_return(sc,sc->value);
}
if(!sc->code) {
Error_0(sc,"syntax error in cond");
}
if(car(sc->code)==sc->FEED_TO) {
if(!is_pair(cdr(sc->code))) {
Error_0(sc,"syntax error in cond");