Skip to content

[release/10.0] Backport #123295: Skip() past the end followed by Concat() throws ArgumentOutOfRangeException - #136718

Open
jeremy-morren wants to merge 3 commits into
dotnet:release/10.0from
jeremy-morren:release/10.0
Open

jeremy-morren wants to merge 3 commits into
dotnet:release/10.0from
jeremy-morren:release/10.0

Conversation

@jeremy-morren

@jeremy-morren jeremy-morren commented Oct 30, 2026 •

Copy link
Copy Markdown

Fix ArgumentOutOfRangeException when Concat called after Skip that skips more elements than exist - Backport of #123295 to net10.

Fixes #123284 on .NET 10.
Fixes #134736

…er Skip that skips more elements than exist

Backport of dotnet#123295 (609e9be) to release/10.0.

IListSkipTakeIterator.Fill sliced the source span unconditionally, so when
Skip() skipped more elements than exist, copying the (empty) result via
CopyTo/ToArray/ToList (e.g. from Concat or Append) threw from Span.Slice.
Guard the copy with sourceIndex < sourceSpan.Length.

Regression introduced by dotnet#112401.

Fixes dotnet#123284 on .NET 10.
Fixes dotnet#134736
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 30, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@jeremy-morren

Copy link
Copy Markdown
Author

@jeffhandley chances of including this PR in the next .NET 10 release?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Linq community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant