Skip to content

Commit

Permalink
Fix use after free
Browse files Browse the repository at this point in the history
One of the tests closes EclFile and then immediately tries to write to it. Close
frees the object, so we check if the current pointer is not NULL.
  • Loading branch information
pinkwah committed Feb 20, 2020
1 parent 13aa157 commit 97dc442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/ecl/eclfile/ecl_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def fwrite( self , fortio ):
self._fwrite( fortio , 0 )

def write_index(self, index_file_name):
if not self._write_index(index_file_name):
if not self or not self._write_index(index_file_name):
raise IOError("Failed to write index file:%s" % index_file_name)


Expand Down

0 comments on commit 97dc442

Please sign in to comment.