1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:47:44 +00:00

LibCrypto+LibTLS: Avoid crashing on invalid input

Fixes #18307.
This commit is contained in:
Ben Wiederhake 2023-05-07 14:20:46 +02:00 committed by Andreas Kling
parent f37f081f15
commit ac5cef1b66
2 changed files with 6 additions and 5 deletions

View file

@ -22,9 +22,10 @@ public:
{
}
ReadonlyBytes raw_bytes() const
ErrorOr<ReadonlyBytes> raw_bytes() const
{
VERIFY(m_unused_bits == 0);
if (m_unused_bits != 0)
return Error::from_string_literal("ASN1::Decoder: BitStringView contains unexpected partial bytes");
return m_data;
}