From: eap Date: Wed, 19 Jun 2013 14:28:05 +0000 (+0000) Subject: 0022232: [CEA 837] Memory corruption in GEOM/SMESH that leads to segfault on debian64 X-Git-Tag: BR_hydro_v_0_3_1~177 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0c3b75095af43d5c5a55fd37a35bf2398956fc66;p=modules%2Fgeom.git 0022232: [CEA 837] Memory corruption in GEOM/SMESH that leads to segfault on debian64 Fix ==7374== Invalid read of size 8 ==7374== at 0x6B1F53F: TCollection_BasicMapIterator::Next() (in libTKernel.so.0.0.0) ==7374== by 0x3A120D3A: GEOMAlgo_Builder::FillInternalShapes() (GEOMAlgo_Builder_3.cxx:717) - in FillInternalShapes() fix removal of map items while iteration through the map --- diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx index 024fa6681..73baab3bb 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx @@ -714,8 +714,9 @@ void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid, TopoDS_Solid aSd=TopoDS::Solid(aIt.Value()); // aItM.Initialize(aMSI); - for (; aItM.More(); aItM.Next()) { + for (; aItM.More(); /*aItM.Next()*/) { TopoDS_Shape aSI=aItM.Key(); + aItM.Next(); // to safely call aMSI.Remove(aSI) aSI.Orientation(TopAbs_INTERNAL); // aState=GEOMAlgo_Tools3D::ComputeStateByOnePoint(aSI, aSd, 1.e-11, aCtx);