From b7cb49c3e3cb70b7c5ae086f80fa576318fca96f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 15 Mar 2014 11:32:03 +0100 Subject: [PATCH] + issue #0001474: crash selecting constraint --- src/Mod/Sketcher/App/Sketch.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 0d1ca669a..36839636e 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1868,6 +1868,9 @@ int Sketch::setDatum(int constrId, double value) int Sketch::getPointId(int geoId, PointPos pos) const { + // do a range check first + if (geoId < 0 || geoId >= Geoms.size()) + return -1; switch (pos) { case start: return Geoms[geoId].startPointId;