DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0027410

Data Exchange, Iges Import - Possible resource leak when parsing an invalid file

CommunityOCCT:Data Exchangeverified2 public notes

Search issues

Description

If an invalid (i.e. non-IGIS) file is being processed by igesread(), it may not close the input FILE* (lefic). This occurs when the initial call to igres_lire() returns -1; in this case, i0 remains 0 and 'if (i0 == 0) return -1;' will be executed without ever closing lefic.

Steps to reproduce

Attempt to load a non-IGES file (for example, some .cpp file) - it will correctly be rejected but the file will remain opened for the duration of the application.

Additional information

Patch attached to fix the problem.

Public activity

2 archived notes

Participants are labeled by their role within this record.

01Commenter 2
I also observed this behaviour in 6.9.0.
02Commenter 3