Repository navigation
Throw CborContentException for dangling tag at end of root-level sequence - #135359
Open
MuhammadBilal64 wants to merge 3 commits into
Open
MuhammadBilal64 wants to merge 3 commits into
MuhammadBilal64 wants to merge 3 commits into
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-formats-cbor, @bartonjs, @vcsjones |
This was referenced Oct 7, 2026
Closed
bartonjs
reviewed
Oct 7, 2026
bartonjs
approved these changes
Oct 8, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #135191
CborReadernow throwsCborContentExceptionwhen a root-level value sequence (AllowMultipleRootLevelValues) ends with a tag that is not followed by a data item, instead of reportingFinished. This applies to both single-buffer and incremental (SlideData) readers, so equivalent states now throw the same exception type.Changes:
PeekStateCore: throw at the end of a root-level sequence if a tag is pendingPeekInitialByte: same check before the end-of-sequence guard, which covers the case where the tag is the only token consumed (SlideDatarebases the offset to zero)PeekState_DanglingTagAtEndOfRootSequence, which asserted the oldFinishedbehavior, and added a test for the tag-only caseNote: this changes shipped behavior.
PeekState()previously returnedFinishedfor a dangling root-level tag.Testing: I verified the scenarios from the issue (before and after the change) with a scratch console project that compiles the library sources. I couldn't run the full
System.Formats.Cbortest suite locally, so I'm relying on CI for that.