Skip to content

Conversation

@ThomsonTan
Copy link
Contributor

When deserializing extension field via TypelessFormatter::Deserialize but without ThisLibraryExtensionTypeCodes.TypelessFormatter shown up in the field extension header, the current deserialize code reads the extension header but doesn't restore it for the following fallback code. This causes fallback deserialize code parsing remaining message payload as header and corrupt the parsing process.

This PR fixes it by creating a peek reader for ExtensionHeader check, and only consumes the header when necessary.

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Nice catch on the bug and fix.

@AArnott AArnott self-assigned this Aug 19, 2020
@AArnott AArnott added this to the v2.1 milestone Aug 19, 2020
@AArnott AArnott added the bug label Aug 19, 2020
@AArnott AArnott merged commit 6e4d9f9 into MessagePack-CSharp:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants