1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibWasm: Move the vector size limit to Constants.h and increase it a bit

This commit is contained in:
Ali Mohammad Pur 2021-09-02 13:08:12 +04:30 committed by Ali Mohammad Pur
parent 566c5d1e99
commit d52a26de3f
2 changed files with 2 additions and 1 deletions

View file

@ -54,7 +54,7 @@ static auto parse_vector(InputStream& stream)
return ParseResult<Vector<T>> { with_eof_check(stream, ParseError::ExpectedSize) };
entries.append(value);
} else if constexpr (IsSame<T, u8>) {
if (count > 64 * KiB)
if (count > Constants::max_allowed_vector_size)
return ParseResult<Vector<T>> { ParseError::HugeAllocationRequested };
entries.resize(count);
if (!stream.read_or_error({ entries.data(), entries.size() }))