Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed small bug when supplying bytes variable to MachO() object #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ayylemao
Copy link

@ayylemao ayylemao commented Jan 30, 2024

If supplying only bytes buffer to MachO() object and running parse(), self.file_name was not properly initialized leading to:

 macho = MachO(data=binary_bytes)
 macho.parse()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "machofile.py", line 391, in parse
    self.general_info = self.get_general_info()
  File "machofile.py", line 425, in get_general_info
    if self.file_path is None:
AttributeError: 'MachO' object has no attribute 'file_path'

fixed that bug by initializing file_path as None in case of only bytes supplied in constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant