fix(serialization): cap codec allocations
Merged
RE
2mo ago+243+243+012345678901234567890123456789-102-102-012345678901234567890123456789
Corrupted length prefixes could cause codecs to allocate objects larger than the remaining serialized payload.
Add a shared remaining-byte check to the reader and apply it before allocating strings, buffers, arrays, collections, and protobuf payloads. Keep exception construction off hot paths and cover malformed lengths, forked readers, and non-seekable streams.