1
0
mirror of https://github.com/simh/simh.git synced 2026-04-15 16:11:13 +00:00

All: Declare sim_stop_messages as an array SCPE_BASE long

This avoids a potential invalid pointer dereference when formatting
the return value from sim_instr() if it is < SCPE_BASE but greater
than the previously defined static array size.sizeof

Update simh.doc to reflect this generic change.
This commit is contained in:
Mark Pizzolato
2020-09-02 15:56:07 -07:00
parent 782fe167ca
commit ae825c9afb
46 changed files with 46 additions and 45 deletions

View File

@@ -1099,7 +1099,7 @@ DEVICE *sim_devices [] = { /* an array of pointers to the s
#define DEVICE_COUNT (sizeof sim_devices / sizeof sim_devices [0] - 1)
const char *sim_stop_messages [] = { /* an array of pointers to the stop messages in STOP_nnn order */
const char *sim_stop_messages [SCPE_BASE] = { /* an array of pointers to the stop messages in STOP_nnn order */
"Impossible error", /* 0 (never returned) */
"System halt", /* STOP_SYSHALT */
"Unimplemented instruction", /* STOP_UNIMPL */