Skip to content

Commit ae68f76

Browse files
authored
Merge pull request #285 from k-okada/fix_sequence
In sequence.c, start/end parameter check is corrected for arrays since specifying start>end caused a segmentation fault.
2 parents 0c3cc51 + 2d49786 commit ae68f76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lisp/c/sequence.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ pointer argv[];
142142
a=a->c.ary.entity;}
143143
if (isvector(a)) {
144144
count=vecsize(a);
145-
if (n==3) e=min(e,count);
145+
if (s>count) error(E_STARTEND);
146+
if (n==3) {
147+
if (e>count) error(E_STARTEND); }
146148
else e=count;
147149
count=e-s;
148150
switch(elmtypeof(a)) {

0 commit comments

Comments
 (0)