Avoid NULL pointer dereference when examining a device with no units. #95
This commit is contained in:
parent
b61e5ae176
commit
fd4a3acbad
1 changed files with 2 additions and 2 deletions
4
scp.c
4
scp.c
|
@ -1185,7 +1185,7 @@ if (dptr->flags & DEV_DEBUG) {
|
||||||
fprintf (st, "%-30s\tDisables specific debugging for device %s\n", buf, sim_dname (dptr));
|
fprintf (st, "%-30s\tDisables specific debugging for device %s\n", buf, sim_dname (dptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((dptr->modifiers) && (dptr->numunits != 1)) {
|
if ((dptr->modifiers) && (dptr->units) && (dptr->numunits != 1)) {
|
||||||
if (dptr->units->flags & UNIT_DISABLE) {
|
if (dptr->units->flags & UNIT_DISABLE) {
|
||||||
fprint_header (st, &found, header);
|
fprint_header (st, &found, header);
|
||||||
sprintf (buf, "set %sn ENABLE", sim_dname (dptr));
|
sprintf (buf, "set %sn ENABLE", sim_dname (dptr));
|
||||||
|
@ -1239,7 +1239,7 @@ if (dptr->flags & DEV_DEBUG) {
|
||||||
sprintf (buf, "show %s DEBUG", sim_dname (dptr));
|
sprintf (buf, "show %s DEBUG", sim_dname (dptr));
|
||||||
fprintf (st, "%-30s\tDisplays debugging status for device %s\n", buf, sim_dname (dptr));
|
fprintf (st, "%-30s\tDisplays debugging status for device %s\n", buf, sim_dname (dptr));
|
||||||
}
|
}
|
||||||
if ((dptr->modifiers) && (dptr->numunits != 1)) {
|
if ((dptr->modifiers) && (dptr->units) && (dptr->numunits != 1)) {
|
||||||
for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) {
|
for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) {
|
||||||
if ((!MODMASK(mptr,MTAB_VUN)) && MODMASK(mptr,MTAB_XTD))
|
if ((!MODMASK(mptr,MTAB_VUN)) && MODMASK(mptr,MTAB_XTD))
|
||||||
continue; /* skip device only modifiers */
|
continue; /* skip device only modifiers */
|
||||||
|
|
Loading…
Add table
Reference in a new issue