1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

Data Exchange - IGES Import Degenerated BSpline crash #368

Degenerated bspline leads to null dereference
Fix BSpline curve check and improve exception handling in TransferBSplineCurve
This commit is contained in:
Pasukhin Dmitry 2025-02-14 14:13:53 +01:00 committed by GitHub
parent 425f88e63a
commit 67bd61d4d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1130,9 +1130,11 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve(
//: 5 BSplineC = new Geom_BSplineCurve(Poles, Weight, Knot, Mult, Degree);
}
// sln 29.12.2001 OCC90 : If curve can not be created do nothing
if (!checkBSplineCurve(this, start, Knot, Weight))
// If curve can not be created do nothing
if (Poles.Size() < 2 || !checkBSplineCurve(this, start, Knot, Weight))
{
return BSplineRes;
}
{
try
@ -1151,6 +1153,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve(
anException.Print(std::cout);
#endif
(void)anException;
return BSplineRes;
}
}