boxer-project / boxer-sunrise

Sunrise on the Boxer Reconstruction Project
BSD 3-Clause "New" or "Revised" License
39 stars 2 forks source link

do-screen-chas-with-font-info and underlying do-vector-contents shouldn't advance past length #49

Open sgithens opened 2 years ago

sgithens commented 2 years ago

When using do-screen-chas-with-font-info and most likely the underlying do-vector-contents it's possible to specify a :stop position longer than the vector, at which point the iterator var gets nil likely causing crashes. I think that it probably all (if not mostly all) cases we should check this and not iterate past the end of the vector. These specialized vectors contain a member with the current length, and the actual storage vector is usually padded past that point with nils for performance reasons.

https://github.com/boxer-project/boxer-sunrise/blob/master/src/definitions/disdef.lisp#L515

https://github.com/boxer-project/boxer-sunrise/blob/master/src/definitions/storage.lisp#L485

image