You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/10/20 10:47:00 UTC

[jira] [Commented] (AVRO-3225) StackOverflowException on invalid input for BinaryDecoder.ReadString on NetStandard 2.1+

    [ https://issues.apache.org/jira/browse/AVRO-3225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17431133#comment-17431133 ] 

ASF subversion and git services commented on AVRO-3225:
-------------------------------------------------------

Commit a1fce29d9675b4dd95dfee9db32cc505d0b2227c in avro's branch refs/heads/master from Philip Sanetra
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=a1fce29 ]

AVRO-3225: AVRO-3226: Fix possible StackOverflowException and OutOfMemoryException on invalid input

* AVRO-3225: Fix possible StackOverflowException on invalid input

* AVRO-3226: Fix possible OutOfMemoryException on invalid input

* AVRO-3226: Backport changes for netstandard2.0

> StackOverflowException on invalid input for BinaryDecoder.ReadString on NetStandard 2.1+
> ----------------------------------------------------------------------------------------
>
>                 Key: AVRO-3225
>                 URL: https://issues.apache.org/jira/browse/AVRO-3225
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>            Reporter: Philip Sanetra
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> The BinaryDecoder.ReadString() method on NetStandard2.1+ produces a stack overflow exception if there is invalid input caused by this code:
>  
> {code:java}
> int length = ReadInt();
> Span<byte> buffer = length <= StackallocThreshold ? stackalloc byte[length] :                (bufferArray = ArrayPool<byte>.Shared.Rent(length)).AsSpan(0, length);
> {code}
>  
> This code fails if ReadInt() returns a negative value.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)