MantisBT - VTK
View Issue Details
0001102VTK(No Category)public2004-08-19 08:202011-01-13 17:00
manimag 
Amy Squillacote 
lowmajoralways
closedfixed 
 
 
0001102: vtkGenericEnSightReader.cxx segfault
When we try to open the geometry file contained in the case file, if the FILE pointer is NULL, the fclose lead to a segmentation fault (see the code that follow).
Moreover, why assuming the file is binary whereas it can simply be absent...

Another problem - to my mind - is the return of vtkGenericEnSightReader::ENSIGHT_6_BINARY (returned 0=ENSIGHT_6 in VTK4.2) : the reading of the case file will continue with the reading of the variable files which is totally useless because we have no geometry. It should be intersting to use the VTK_OK and VTK_ERROR flags (as it is done in PLOT3DReader) to stop the update or the execute.


in VTK4.4 line 466
        this->IFile = fopen(sfilename.c_str(), "rb");
        if (this->IFile == NULL)
          {
          vtkErrorMacro("Unable to open file: " << sfilename.c_str());
          vtkWarningMacro("Assuming binary file.");
          fclose(this->IFile);
          this->IFile = NULL;
          delete [] fileName;
          return vtkGenericEnSightReader::ENSIGHT_6_BINARY;
          } // end if IFile == NULL
No tags attached.
Issue History
2010-11-29 17:59Amy SquillacoteSource_changeset_attached => VTK master 81fd7e4e
2011-01-13 17:00Source_changeset_attached => VTK master a2bd8391
2011-01-13 17:00Source_changeset_attached => VTK master 020ef709
2011-06-16 13:11Zack GalbreathCategory => (No Category)

Notes
(0001397)
Amy Squillacote   
2004-08-23 13:03   
This has been fixed on the main CVS tree.