Commit c8eea24d3b59e552bb9ebfd8e4f0008c4660f3e3
Committed by
GitHub
1 parent
e72b85c7
Use correct variable when raising UnexpectedDataError on REFERENCENAME parsing
Code was using the incorrect variable of 'value', an unrelated string created early in the function. This will cause an error when the exception is raised due to an invalid hex formatting. -Brad
Showing
1 changed file
with
1 additions
and
1 deletions
oletools/olevba.py
| ... | ... | @@ -1411,7 +1411,7 @@ def _extract_vba(ole, vba_root, project_path, dir_path, relaxed=False): |
| 1411 | 1411 | reference_reserved = struct.unpack("<H", dir_stream.read(2))[0] |
| 1412 | 1412 | if reference_reserved not in (0x003E, 0x000D): |
| 1413 | 1413 | raise UnexpectedDataError(dir_path, 'REFERENCE_Reserved', |
| 1414 | - (0x003E, 0x000D), value) | |
| 1414 | + (0x003E, 0x000D), reference_reserved) | |
| 1415 | 1415 | reference_sizeof_name_unicode = struct.unpack("<L", dir_stream.read(4))[0] |
| 1416 | 1416 | reference_name_unicode = dir_stream.read(reference_sizeof_name_unicode) |
| 1417 | 1417 | unused = reference_id | ... | ... |