Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StepToTopoDS_TranslateEdgeLoop::Init() may crash with certain STEP files #607

Open
mikedstrong opened this issue Feb 11, 2016 · 1 comment

Comments

@mikedstrong
Copy link

I experienced a crash in StepToTopoDS_TranslateEdgeLoop::Init() with certain STEP files containing unusual geometry (mine was created using a CAD model containing a cosmetic feature). The crash occurred at line 330:

StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);

It occurred because Vstart was undefined, and this was because curve C was null. To fix this, I added a else case to the existing test for a null curve and returned an error, instead of continuing. My new code looks like this (with commented-out code removed):

if (!C.IsNull()){
  if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve))) {
    Handle(StepGeom_SurfaceCurve) Sc = Handle(StepGeom_SurfaceCurve)::DownCast(C);
    C = Sc->Curve3d();
  }
}
else {
    TP->AddWarning(EL,"Null Curve.");
    done = Standard_False;
    return;
}

Please find attached a simple STEP file that demonstrates the crash.

crash.zip

@ghost
Copy link

ghost commented Mar 31, 2016

Reported to OCCT: http://tracker.dev.opencascade.org/view.php?id=27330

@ghost ghost self-assigned this Mar 31, 2016
@ghost ghost added the Reported to OCCT label Mar 31, 2016
@ghost ghost removed their assignment Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant