Repository navigation
Fix nullable struct deserialization across buffer boundaries - #135477
Open
eiriktsarpalis wants to merge 1 commit into
Open
eiriktsarpalis wants to merge 1 commit into
eiriktsarpalis wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a057a99f-e202-4c25-a1ee-247c2e9c0a5d
|
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-text-json |
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.
Streaming deserialization can throw
JsonExceptionfor valid JSON when a buffer boundary follows anullmember inside a nullable struct.ReadStack.Push()clearsIsContinuationwhen restoring the deepest suspended frame, causingNullableConverter<T>to treat the member token as a null nullable value. RequireObjectState.Nonebefore taking that fast path.Adds boundary sweeps, short-read and buffer-growth checks, and direct
PipeReadertests for segmented buffers, one-byte flushes, and truncated input, with reflection and source-generated metadata.On Windows, all 96 targeted cases per framework passed on
net11.0andnet481; reverting the fix produces 48 failures per framework. All six System.Text.Json test projects passed with zero failures and 17 existing skips.Resolves #110450
Note
This pull request was created with GitHub Copilot.