From 053a56e267426d5f316690e44390bdb512de41ce Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 17 Dec 2015 18:51:21 +0100 Subject: [PATCH] src/ciderlib/oned/onesetup.c, bug fix, access beyond array bounds --- src/ciderlib/oned/onesetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ciderlib/oned/onesetup.c b/src/ciderlib/oned/onesetup.c index f6d0f716c..5db457808 100644 --- a/src/ciderlib/oned/onesetup.c +++ b/src/ciderlib/oned/onesetup.c @@ -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;