From d96c8421d4ebea648c8e1d666fdb8fbf52fea4e6 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 17 Mar 2017 14:23:01 +0100 Subject: [PATCH] Sketcher: Assertion on solver bspline control point creation to expose any potential index miscalculation and memory overflow --- src/Mod/Sketcher/App/Sketch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 44598f4f14..94d383976a 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -2474,6 +2474,8 @@ int Sketch::addInternalAlignmentBSplineControlPoint(int geoId1, int geoId2, int GCS::Circle &c = Circles[Geoms[geoId2].index]; GCS::BSpline &b = BSplines[Geoms[geoId1].index]; + + assert( poleindex < b.poles.size() && poleindex >= 0 ); int tag = ++ConstraintsCounter; GCSsys.addConstraintInternalAlignmentBSplineControlPoint(b, c, poleindex, tag);