src/ciderlib/oned/onesetup.c, bug fix, access beyond array bounds

This commit is contained in:
rlar 2015-12-17 18:51:21 +01:00
parent c94d7153fd
commit 053a56e267
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ ONEcopyBCinfo(ONEdevice *pDevice, ONEelem *pElem, BDRYcard *bdry, int index)
/* Now add surface recombination. */
/* Compute semiconductor length around this node. */
length = 0.0;
for (eIndex = 0; eIndex <= 3; eIndex++) {
for (eIndex = 0; eIndex <= 1; eIndex++) {
pNElem = pNode->pElems[eIndex];
if ((pNElem != NULL) && (pElem->elemType == SEMICON)) {
length += 0.5 * pElem->dx;