Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading of Decimal broken for binary XmlDictionaryReader #73934

Closed
Daniel-Svensson opened this issue Aug 15, 2022 · 3 comments · Fixed by #73332
Closed

Reading of Decimal broken for binary XmlDictionaryReader #73934

Daniel-Svensson opened this issue Aug 15, 2022 · 3 comments · Fixed by #73332

Comments

@Daniel-Svensson
Copy link
Contributor

Description

 #71752 introduced 2 bugs for reading of decimal values from binary xml

  1. It forget to call Advance
  2. it reads the bytes in incorrect order resulting in either the wrong decimal value being read or an exception being thrown.

A fix for both bugs can be found in #73332 since that PR already had the necessary test added to detect the 2nd bug.

Reproduction Steps

See test in #73332
Or just try to roundtrip a decimal directly using XmlDictionaryWriter XmlDictionaryReader

Expected behavior

The reader should properly read decimal values the same as in previous releases.

Actual behavior

Code will throw or return the wrong result

Regression?

Yes, worked in net framework and up to net7 preview.7

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 15, 2022
@danmoseley
Copy link
Member

@StephenMolloy

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 15, 2022
@ghost
Copy link

ghost commented Aug 15, 2022

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

 #71752 introduced 2 bugs for reading of decimal values from binary xml

  1. It forget to call Advance
  2. it reads the bytes in incorrect order resulting in either the wrong decimal value being read or an exception being thrown.

A fix for both bugs can be found in #73332 since that PR already had the necessary test added to detect the 2nd bug.

Reproduction Steps

See test in #73332
Or just try to roundtrip a decimal directly using XmlDictionaryWriter XmlDictionaryReader

Expected behavior

The reader should properly read decimal values the same as in previous releases.

Actual behavior

Code will throw or return the wrong result

Regression?

Yes, worked in net framework and up to net7 preview.7

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: Daniel-Svensson
Assignees: -
Labels:

area-System.Xml, untriaged, in-pr

Milestone: -

@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Aug 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants