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 ASN1Reader::tag2str #1047

Merged
merged 1 commit into from Apr 27, 2024
Merged

Conversation

yuki-mogi-ffri
Copy link
Contributor

This PR will fix #1046.

This pull request adds a string length check before executing the substr in the std::string ASN1Reader::tag2str function.

Specifically, the function has been changed to return MBEDTLS_ASN1_UNKNOWN if the size of tag_str is less than 3.

Now ASN1Reader::tag2str function returns MBEDTLS_ASN1_UNKNOWN instead of throwing an out-of-range exception if the size of  is less than 3.
@romainthomas
Copy link
Member

Look good! Thank you.

@romainthomas romainthomas merged commit 54d0a72 into lief-project:master Apr 27, 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.

`lief.PE.parse' function throws an out-of-range exception
2 participants