Commit 6fcf5ada94c82c6515b3a676c95d4f512ddf475b

Authored by decalage2
1 parent dcecff4e

rtfobj: fixed call to RtfParser._end_of_file (issue #185)

oletools/rtfobj.py
@@ -74,8 +74,9 @@ http://www.decalage.info/python/oletools @@ -74,8 +74,9 @@ http://www.decalage.info/python/oletools
74 # 2017-06-08 PL: - fixed issue/PR #143: bin object with negative length 74 # 2017-06-08 PL: - fixed issue/PR #143: bin object with negative length
75 # 2017-06-29 PL: - temporary fix for issue #178 75 # 2017-06-29 PL: - temporary fix for issue #178
76 # 2017-07-14 v0.51.1 PL: - disabled logging of each control word (issue #184) 76 # 2017-07-14 v0.51.1 PL: - disabled logging of each control word (issue #184)
  77 +# 2017-07-24 PL: - fixed call to RtfParser._end_of_file (issue #185)
77 78
78 -__version__ = '0.51.1dev2' 79 +__version__ = '0.51.1dev3'
79 80
80 # ------------------------------------------------------------------------------ 81 # ------------------------------------------------------------------------------
81 # TODO: 82 # TODO:
@@ -411,7 +412,8 @@ class RtfParser(object): @@ -411,7 +412,8 @@ class RtfParser(object):
411 self.index += len(m.group()) 412 self.index += len(m.group())
412 continue 413 continue
413 raise RuntimeError('Should not have reached this point - index=%Xh' % self.index) 414 raise RuntimeError('Should not have reached this point - index=%Xh' % self.index)
414 - self.end_of_file() 415 + # call _end_of_file to make sure all groups are closed properly
  416 + self._end_of_file()
415 417
416 418
417 def _open_group(self): 419 def _open_group(self):
@@ -527,7 +529,7 @@ class RtfParser(object): @@ -527,7 +529,7 @@ class RtfParser(object):
527 # log.debug('%Xh Reached End of File') 529 # log.debug('%Xh Reached End of File')
528 # close any group/destination that is still open: 530 # close any group/destination that is still open:
529 while self.group_level > 0: 531 while self.group_level > 0:
530 - # log.debug('Group Level = %d, closing group' % self.group_level) 532 + log.debug('Group Level = %d, closing group' % self.group_level)
531 self._close_group() 533 self._close_group()
532 self.end_of_file() 534 self.end_of_file()
533 535
setup.py
@@ -41,7 +41,7 @@ import os, fnmatch @@ -41,7 +41,7 @@ import os, fnmatch
41 #--- METADATA ----------------------------------------------------------------- 41 #--- METADATA -----------------------------------------------------------------
42 42
43 name = "oletools" 43 name = "oletools"
44 -version = '0.51.1dev2' 44 +version = '0.51.1dev3'
45 desc = "Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR" 45 desc = "Python tools to analyze security characteristics of MS Office and OLE files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), for Malware Analysis and Incident Response #DFIR"
46 long_desc = open('oletools/README.rst').read() 46 long_desc = open('oletools/README.rst').read()
47 author = "Philippe Lagadec" 47 author = "Philippe Lagadec"