You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
First of all thanks for the huge work.
I've encountered a variable reference error + an index out of range while using olefile.py.
Trace:
#!text
Traceback (most recent call last):
File "/libs/olefile.py", line 2103, in getproperties
s = b"****" + fp.read(i32(fp.read(4))-4)
File "/libs/olefile.py", line 493, in i32
return i8(c[o]) | (i8(c[o+1])<<8) | (i8(c[o+2])<<16) | (i8(c[o+3])<<24)
IndexError: index out of range
During handling of the above exception, another exception occurred:
#!text
Traceback (most recent call last):
File "/ole2_compound/ole2_compound.py", line 45, in decode
if is_encoded(data):
File "/ole2_compound/ole2_compound.py", line 274, in is_encoded
office_type, office_properties = detect_office_file_type(ole)
File "/ole2_compound/ole2_compound.py", line 92, in detect_office_file_type
properties = ole.getproperties(['\x05SummaryInformation'])
File "/libs/olefile.py", line 2112, in getproperties
self._raise_defect(DEFECT_INCORRECT, msg, type(exc))
UnboundLocalError: local variable 'type' referenced before assignment
Attached is the xls file causing the errors. (310445.xls)
Using python 3.2.
olefile version 0.42 2015-01-25
Original comment byPhilippe Lagadec (Bitbucket: decalage, GitHub: decalage2):
Same issue reported by Ross Spencer:
Line 2213 you're trying to access the function type() e.g. type(exc) but previously, line 2120 you create a variable called type e.g. type = i32(s, offset), this is overriding your ability to access the function at the exception point.
#!text
File "C:\Working\git\oletools\oletools\thirdparty\olefile\olefile.py", line 2212, in getproperties
self._raise_defect(DEFECT_INCORRECT, msg, type(exc))
UnboundLocalError: local variable 'type' referenced before assignment
Solution: rename the local variable "type" to property_type.
Originally reported by: Meni Farjon (Bitbucket: solebitlabs_meni_farjon, GitHub: Unknown)
Hi,
First of all thanks for the huge work.
I've encountered a variable reference error + an index out of range while using olefile.py.
Trace:
During handling of the above exception, another exception occurred:
Attached is the xls file causing the errors. (310445.xls)
Using python 3.2.
olefile version 0.42 2015-01-25
Thanks!
The text was updated successfully, but these errors were encountered: