0000668: getPole() does not provide proper bound checking
This commit is contained in:
@@ -393,6 +393,8 @@ PyObject* BSplineCurvePy::getPole(PyObject * args)
|
||||
try {
|
||||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_OutOfRange_Raise_if
|
||||
(index < 1 || index > curve->NbPoles(), "Pole index out of range");
|
||||
gp_Pnt pnt = curve->Pole(index);
|
||||
Base::VectorPy* vec = new Base::VectorPy(Base::Vector3d(
|
||||
pnt.X(), pnt.Y(), pnt.Z()));
|
||||
@@ -457,6 +459,8 @@ PyObject* BSplineCurvePy::getWeight(PyObject * args)
|
||||
try {
|
||||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_OutOfRange_Raise_if
|
||||
(index < 1 || index > curve->NbPoles() , "Weight index out of range");
|
||||
double weight = curve->Weight(index);
|
||||
return Py_BuildValue("d", weight);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user