MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #32314 All Revisions ] Back to Issue ]
Summary 0032314: Data Exchange - Reading corrupted STEP files crashes
Revision 2021-04-22 11:35 by kgv
Steps To Reproduce
pload XDE OCAF
dsetsignal unset
testreadstep corrupted.stp s
ReadStep D corrupted.stp


The following lines of code produce this error:
    STEPControl_Reader reader;
    IFSelect_ReturnStatus result =  reader.ReadFile("corrupted.stp"); // returns "Done" 
with a few errors
    reader.TransferRoots(); // crashes


The root cause seems to be dereferencing a nullptr (directionRatios) in this method:
Standard_Integer StepGeom_Direction::NbDirectionRatios () const
{
    return directionRatios->Length();
}


However, I am not sure, what the correct solution would look like. Probably it would be best to return IFSelect_RetError from ReadFile(...) in these cases.
Revision 2021-04-22 11:31 by kgv
Steps To Reproduce The following lines of code produce this error:
    STEPControl_Reader reader;
    IFSelect_ReturnStatus result =  reader.ReadFile("corrupted.stp"); // returns "Done" 
with a few errors
    reader.TransferRoots(); // crashes


The root cause seems to be dereferencing a nullptr (directionRatios) in this method:
Standard_Integer StepGeom_Direction::NbDirectionRatios () const
{
    return directionRatios->Length();
}


However, I am not sure, what the correct solution would look like. Probably it would be best to return IFSelect_RetError from ReadFile(...) in these cases.
Revision 2021-04-21 16:40 by Tilo Pfliegner
Steps To Reproduce The following lines of code produce this error:
    STEPControl_Reader reader;
    IFSelect_ReturnStatus result = reader.ReadFile("corrupted.stp"); // returns "Done" with a few errors
    reader.TransferRoots(); // crashes

The root cause seems to be dereferencing a nullptr (directionRatios) in this method:
Standard_Integer StepGeom_Direction::NbDirectionRatios () const
{
    return directionRatios->Length();
}

However, I am not sure, what the correct solution would look like. Probably it would be best to return IFSelect_RetError from ReadFile(...) in these cases.


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker