PDP11, All VAX: fix CID: 1415538, 1415766 ("Dereference before null check")

This commit is contained in:
Sergey Svishchev 2017-03-09 17:19:09 -08:00 committed by Mark Pizzolato
parent abc1afc07e
commit 4bee16578a

View file

@ -839,8 +839,10 @@ if (autcon_enb == 0) /* enabled? */
return SCPE_OK;
if (name) { /* updating? */
dptr = find_dev (name);
if (dptr == NULL)
return SCPE_ARG;
dibp = (DIB *) dptr->ctxt; /* get DIB */
if ((nctrl < 0) || (dptr == NULL) || (dibp == NULL))
if ((nctrl < 0) || (dibp == NULL))
return SCPE_ARG;
dibp->numc = nctrl;
}