Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringSegment doesn't handle null buffers consistently #45021

Closed
GrabYourPitchforks opened this issue Nov 20, 2020 · 1 comment · Fixed by #55501
Closed

StringSegment doesn't handle null buffers consistently #45021

GrabYourPitchforks opened this issue Nov 20, 2020 · 1 comment · Fixed by #55501
Labels
area-Extensions-Primitives bug help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@GrabYourPitchforks
Copy link
Member

GrabYourPitchforks commented Nov 20, 2020

Microsoft.Extensions.Primitives.StringSegment does not handle null backing buffers consistently. One example:

Console.WriteLine(default(StringSegment).IndexOfAny(new[] { 'x' })); // prints -1
Console.WriteLine(default(StringSegment).IndexOf('x')); // throws ArgumentOutOfRangeException
Console.WriteLine(default(StringSegment).LastIndexOf('x')); // prints -1

(Related: #39140)

@ghost
Copy link

ghost commented Nov 20, 2020

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

Microsoft.Extensions.Primitives.StringSegment does not handle null backing buffers consistently. One example:

Console.WriteLine(default(StringSegment).IndexOfAny(new[] { 'x' })); // prints -1
Console.WriteLine(default(StringSegment).IndexOf('x')); // throws ArgumentOutOfRangeException

(Related: #39140)

Author: GrabYourPitchforks
Assignees: -
Labels:

area-Extensions-Primitives, bug

Milestone: -

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 20, 2020
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 28, 2020
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 30, 2021
@maryamariyan maryamariyan added this to the Future milestone Apr 8, 2021
@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label Apr 8, 2021
@ghost ghost moved this from Untriaged to Future in ML, Extensions, Globalization, etc, POD. Apr 8, 2021
@maryamariyan maryamariyan added the help wanted [up-for-grabs] Good issue for external contributors label Apr 8, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 12, 2021
ML, Extensions, Globalization, etc, POD. automation moved this from Future to Done Jul 15, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Primitives bug help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants