The Portable Space Code has provision for a number of separate universes. There is a constant, SPACE_LIMIT, defined in the spaceconf.h file. This value is used to directly initialise the array used for each space.
Unfortunately, there are a number of places SPACE_LIMIT is incorrectly checked, and where it is possible to access data beyond the allocated space. (A number of checks are made for > SPACE_LIMIT, where the correct check is >= SPACE_LIMIT)
This patch corrects these limit checks, and so prevents an out of bounds pointer from crashing the engine.
This code is provided as a service to the community using the Portable Space Code. By using this code, you agree that the author is not responsible in any way for any damage caused.