[ 
https://issues.apache.org/jira/browse/AVRO-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kalle Niemitalo updated AVRO-3569:
----------------------------------
    Affects Version/s: 1.12.0

> C# infinite recursion in IConvertible.ToByte(System.IFormatProvider) of 
> AvroDecimal
> -----------------------------------------------------------------------------------
>
>                 Key: AVRO-3569
>                 URL: https://issues.apache.org/jira/browse/AVRO-3569
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp, logical types
>    Affects Versions: 1.11.0, 1.12.0
>         Environment: .NET SDK 6.0.301 on Windows 10 x64
>            Reporter: Kalle Niemitalo
>            Priority: Major
>
> h2. To reproduce
> {code:C#}
> using System;
> using Avro;
> class Program
> {
>     static void Main()
>     {
>         Convert.ToByte(new AvroDecimal(0));
>     }
> }
> {code}
> h2. Expected result
> Convert.ToByte returns (byte)0, and the program does not output anything.
> h2. Actual result
> {noformat}
> Stack overflow.
> Repeat 13759 times:
> --------------------------------
>    at Avro.AvroDecimal.System.IConvertible.ToByte(System.IFormatProvider)
>    at System.Convert.ToByte(System.Object, System.IFormatProvider)
> --------------------------------
>    at Avro.AvroDecimal.System.IConvertible.ToByte(System.IFormatProvider)
>    at System.Convert.ToByte(System.Object)
>    at Program.Main()
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to