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

fix empty header error #9

Merged
merged 1 commit into from
Feb 28, 2024
Merged

fix empty header error #9

merged 1 commit into from
Feb 28, 2024

Conversation

marin-jovanovic
Copy link
Contributor

In case the file is empty header is empty.
This can is not handled and following exception is raised:

File "file_signatures.py", line 1493, in compare_sig
    if _byte != file_header[_loc]:
IndexError: list index out of range

This can be reproduced by calling
Matches(header=[])

This PR takes fixes that

Copy link
Owner

@schlerp schlerp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent catch! When I wrote this library i had a very specific use case! Im glad others are finding it useful. Thanks for contributing :)

LGTM 🚀

Will be in next release which will be this week.

@schlerp schlerp merged commit 971d5f0 into schlerp:master Feb 28, 2024
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