1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030202: IntPatch_WLineTool::JoinWLines array out of bounds

The main idea of the fix is that the creation of WLine with one point is forbidden.
This commit is contained in:
nbv
2018-10-05 10:50:51 +03:00
committed by apn
parent dcf0889fc2
commit dcd768a49a
3 changed files with 86 additions and 2 deletions

View File

@@ -3363,7 +3363,13 @@ static IntPatch_ImpImpIntersection::IntStatus
aP.SetTolerance(aTol3D);
aP.SetValue(aWLine[i]->Point(1).Value());
theSPnt.Append(aP);
//Check whether the added point exists.
//It is enough to check the last point.
if (theSPnt.IsEmpty() ||
!theSPnt.Last().PntOn2S().IsSame(aP.PntOn2S(), Precision::Confusion()))
{
theSPnt.Append(aP);
}
}
else if (aWLine[i]->NbPnts() > 1)
{
@@ -3582,7 +3588,7 @@ static IntPatch_ImpImpIntersection::IntStatus
// another point in the interval [anUC, anUsup] if anUC is intersection point and
// in the interval [anUmid, anUC], otherwise.
Standard_Real anAddedPar[2] = { anUmid, anUmid };
Standard_Real anAddedPar[2] = {isReversed ? u2 : u1, isReversed ? u2 : u1};
for (Standard_Integer aParID = 0; aParID < 2; aParID++)
{