Description
The BinaryDecoder.ReadString() method on NetStandard2.1+ produces an OutOfMemoryException if there is invalid input caused by this code:
int length = ReadInt(); Span<byte> buffer = length <= StackallocThreshold ? stackalloc byte[length] : (bufferArray = ArrayPool<byte>.Shared.Rent(length)).AsSpan(0, length);
ArrayPool<byte>.Shared.Rent(length) will cause the exception if ReadInt() returns a big number like int.MaxValue.
Attachments
Issue Links
- is related to
-
AVRO-3225 StackOverflowException on invalid input for BinaryDecoder.ReadString on NetStandard 2.1+
- Resolved