Fix Incorrect xml read deserialing byte array #2201
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change from using
ReadString()
toReadElementString()
when deserialization a byte array. The expectation forToByteArrayHex()
andToByteArrayBase64()
is that theXmlDocument
will be left at the start of next Xml element. But with just aReadString()
the document is left at the end tag of the current element, not the start of the next element. Changing toReadElementString()
changes this behavior.This only affects the mobile profile - the Mono desktop profile uses a different implementation that doesn't have this issue. I also validated the CoreCLR matches the Mono Desktop profile behavior.
Reviewers: please consider these questions as well! ❤️
Release notes
Fixed UUM-195284 @scott-ferguson-unity
IL2CPP: Fix XML Deserialization of a byte array leaving the reader at the wrong element