summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-12-10 00:02:34 -0800
committerKeith Packard <keithp@keithp.com>2017-12-10 00:02:34 -0800
commitabb856cd66e00d739e4efb1930b5c168eaf48029 (patch)
tree7c2ec035bff2764518eceeba11012e250fd5ca42 /src
parent17fe6de833cccb6d43d0ac0ed84a4faaa3463a09 (diff)
altos/scheme: Avoid crashing with non-list in length
Use ao_scheme_cons_cdr to fetch the next list element as that returns NULL for non-cons elements. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/scheme/ao_scheme_cons.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scheme/ao_scheme_cons.c b/src/scheme/ao_scheme_cons.c
index 03dad956..21ee10cc 100644
--- a/src/scheme/ao_scheme_cons.c
+++ b/src/scheme/ao_scheme_cons.c
@@ -195,7 +195,7 @@ ao_scheme_cons_length(struct ao_scheme_cons *cons)
int len = 0;
while (cons) {
len++;
- cons = ao_scheme_poly_cons(cons->cdr);
+ cons = ao_scheme_cons_cdr(cons);
}
return len;
}