Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix another Uri debug assert - #123075

#123075
Merged
MihaZupan merged 1 commit into
dotnet:maindotnet/runtime:mainfrom
MihaZupan:uri-debugAssertEmptyOverlapMihaZupan/runtime:uri-debugAssertEmptyOverlapCopy head branch name to clipboard
Jan 12, 2026
Merged

Fix another Uri debug assert#123075
MihaZupan merged 1 commit into
dotnet:maindotnet/runtime:mainfrom
MihaZupan:uri-debugAssertEmptyOverlapMihaZupan/runtime:uri-debugAssertEmptyOverlapCopy head branch name to clipboard

Conversation

@MihaZupan

Copy link
Copy Markdown
Member

Overlaps special-cases empty spans as not overlapping even if the pointer appears in the middle.
In this case, the LocalPath test exercises the UriFormat.Unescaped code path.

@MihaZupan MihaZupan added this to the 11.0.0 milestone Jan 11, 2026
@MihaZupan MihaZupan self-assigned this Jan 11, 2026
Copilot AI review requested due to automatic review settings January 11, 2026 16:06
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a debug assertion failure that occurs when processing URIs with empty paths in the UriFormat.Unescaped code path. The issue arises because the Overlaps method can incorrectly report that an empty span doesn't overlap with a buffer, even though the operation is valid.

Changes:

  • Modified debug assertion in Uri.cs to handle empty spans correctly
  • Added test assertions to verify AbsolutePath and LocalPath properties for an FTP URI with a compressed path

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/libraries/System.Private.Uri/src/System/Uri.cs Fixed debug assertion to check if span is empty before calling Overlaps
src/libraries/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs Added test assertions to exercise the UriFormat.Unescaped code path with an empty path

@MihaZupan
MihaZupan merged commit c637246 into dotnet:main Jan 12, 2026
94 of 97 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.