MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030201Community[OCCT] OCCT:Modeling Algorithmspublic2018-10-04 19:012019-08-12 17:59
Reportergalbramc 
Assigned Tojgv 
PrioritynormalSeveritycrash 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030201: ChFi3d_Builder::PerformMoreThreeCorner segfault by using nullptr
DescriptionBRep_Tool::CurveOnSurface on lines 2225 and 2235 can set curv2d1 or curv2d2 to null. These variables are then used without checking for the null value leading to a segfault. Throwing an exception in the following patch is a band aid that avoids the segfault, but does not resolve the desire for a fillet.

Index: src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
===================================================================
--- src/ChFi3d/ChFi3d_Builder_CnCrn.cxx (revision 1)
+++ src/ChFi3d/ChFi3d_Builder_CnCrn.cxx (working copy)
@@ -2226,6 +2226,7 @@
                                               u1bid,u2bid);
     else
       Calcul_C2dOnFace(CD.Value(ic),jf.Value(ic),i.Value(ic,icplus),curv2d1);
+ if(curv2d1.IsNull()) throw Standard_ConstructionError("PChFi3d_Builder::PerformMoreThreeCorner : curv2d1 is null");
     p2d1 = curv2d1 ->Value(p.Value(ic,icplus));
     
     // recuperation de la deuxieme courbe 2d
@@ -2237,6 +2238,7 @@
       jfp = 3 - jf.Value(icplus);
       Calcul_C2dOnFace(CD.Value(icplus),jfp,i.Value(icplus,ic),curv2d2);
     }
+ if(curv2d2.IsNull()) throw Standard_ConstructionError("PChFi3d_Builder::PerformMoreThreeCorner : curv2d2 is null");
     p2d2 = curv2d2 ->Value(p.Value(icplus,ic));
 
     Asurf = new GeomAdaptor_HSurface(BRep_Tool::Surface(TopoDS::Face(Fvive.Value(ic,icplus))));
Steps To ReproduceRun attached code with shape.brep.
TagsNo tags attached.
Test case number
Attached Filestgz file icon ChFi3d_nullptr.tgz (6,763 bytes) 2018-10-04 19:01

- Relationships

-  Notes
(0081867)
galbramc (reporter)
2019-01-23 16:23

Any luck with getting this use of a null pointer resolved?

- Issue History
Date Modified Username Field Change
2018-10-04 19:01 galbramc New Issue
2018-10-04 19:01 galbramc Assigned To => msv
2018-10-04 19:01 galbramc File Added: ChFi3d_nullptr.tgz
2018-10-12 20:41 abv Target Version => 7.4.0
2018-10-15 10:15 msv Assigned To msv => jgv
2018-10-15 10:15 msv Status new => assigned
2019-01-23 16:23 galbramc Note Added: 0081867
2019-08-12 17:59 msv Target Version 7.4.0 => 7.5.0*


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker