Browse Source

Don't dereference a NULL pointer.

pre-master-46
Vogt 2 years ago
committed by Holger Vogt
parent
commit
232101af10
  1. 8
      src/spicelib/analysis/cktsetup.c

8
src/spicelib/analysis/cktsetup.c

@ -171,10 +171,12 @@ CKTsetup(CKTcircuit *ckt)
BindNode.CSC = NULL ; BindNode.CSC = NULL ;
BindNode.CSC_Complex = NULL ; BindNode.CSC_Complex = NULL ;
matched = (BindElement *) bsearch (&BindNode, BindStruct, nz, sizeof (BindElement), BindCompare) ; matched = (BindElement *) bsearch (&BindNode, BindStruct, nz, sizeof (BindElement), BindCompare) ;
if (matched == NULL) {
printf ("Ptr %p not found in BindStruct Table\n", ckt->enh->rshunt_data.diag [i]) ;
if (!matched) {
fprintf (stderr, "Error: Ptr %p not found in BindStruct Table\n", ckt->enh->rshunt_data.diag [i]) ;
ckt->enh->rshunt_data.diag[i] = NULL;
} }
ckt->enh->rshunt_data.diag [i] = matched->CSC ;
else
ckt->enh->rshunt_data.diag [i] = matched->CSC ;
i++; i++;
} }
} }

Loading…
Cancel
Save