Skip to content

Commit

Permalink
Merge pull request #1047 from FFRI/fix-out-of-range
Browse files Browse the repository at this point in the history
fix ASN1Reader::tag2str
  • Loading branch information
romainthomas committed Apr 27, 2024
2 parents 4d8211a + 10fa404 commit 54d0a72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BinaryStream/ASN1Reader.cpp
Expand Up @@ -473,6 +473,10 @@ std::string ASN1Reader::tag2str(int tag) {
HANDLE(ASN1_CONSTRUCTED);
HANDLE(ASN1_CONTEXT_SPECIFIC);

if (tag_str.size() < 3) {
return "MBEDTLS_ASN1_UNKNOWN";
}

return tag_str.substr(3);
#undef HANDLE
}
Expand Down

0 comments on commit 54d0a72

Please sign in to comment.