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

Exceptions on malformed ELF header contents #552

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

sevaa
Copy link
Contributor

@sevaa sevaa commented Apr 16, 2024

Addresses #369, #370. Instead of infinite loops, the library will raise exceptions.

I don't know what was the original motivation for making e_shentsize and e_phentsize variable; assuming it was for some kind of vendor extensions, but if the size is less than the mandated fields, ELFFile will now throw.

elftools/elf/elffile.py Outdated Show resolved Hide resolved
@sevaa
Copy link
Contributor Author

sevaa commented Apr 16, 2024

No more magic constants.

@eliben eliben merged commit 9257a0f into eliben:main Apr 17, 2024
4 checks passed
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.

2 participants