1
0
mirror of https://github.com/simh/simh.git synced 2026-05-18 02:38:20 +00:00

SCP: Set appropriate uptr when SHOWing something in the default device (CPU)

- Avoid null pointer dereference in these cases

Credit (John D. Bruner) for reporting the problem.  His fix wasn't complete.
This commit is contained in:
John D. Bruner
2026-03-03 17:33:14 -10:00
committed by Mark Pizzolato
parent 6e279976f6
commit c6ec912cbe

2
scp.c
View File

@@ -6456,6 +6456,7 @@ else {
for (mptr = sim_dflt_dev->modifiers; mptr->mask != 0; mptr++) {
if (mptr->mstring && (MATCH_CMD (gbuf, mptr->mstring) == 0)) {
dptr = sim_dflt_dev;
uptr = dptr->units;
cptr = svptr;
while (sim_isspace(*cptr))
++cptr;
@@ -6777,6 +6778,7 @@ else {
(mptr->pstring && (MATCH_CMD (gbuf, mptr->pstring) == 0))) ||
(!(mptr->mask & MTAB_VDV) && (mptr->mstring && (MATCH_CMD (gbuf, mptr->mstring) == 0)))) {
dptr = sim_dflt_dev;
uptr = dptr->units;
lvl = MTAB_VDV; /* device match */
cptr = svptr;
while (sim_isspace(*cptr))