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
Backport #32277 to 5.0 #32470
Backport #32277 to 5.0 #32470
Conversation
* Stop throwing exception when writing 0 length buffers Fixes: #31299 * Leverage runtime checks & add test https://github.com/dotnet/runtime/blob/7938f9d9fadc3952d792329be602668bef124f23/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs#L159
Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge. |
This has been approved by Tactics. Thanks @TanayParikh! |
So this was suppose to fix this issue??:
This last patch broke production, and since this has high-jacked the action setup script on github. |
Hi @Theoistic. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
@sebastienros .. fyi |
Hi @Theoistic. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Thanks for reaching out @Theoistic. Can you please file a new issue with those details, as well as any other information you may have (input arguments to that function, repro steps, etc.). |
Description
Update guard logic to permit writing 0 length buffers. This can happen in certain globalized scenarios (ex.
¿
with Portugese) where the first char needs to be encoded.Patch #31299 for 5.0 by cherry-picking the #32277 squash commit.
Customer Impact
Writing 0-length char buffers leads to an ArgumentOutOfRangeException. This may occur in a globalization context with certain chars such as
¿
.#31299 (comment)
Also impacts Orchard: #31299 (comment)
Regression?
[If yes, specify the version the behavior has regressed from]
Risk
Low risk as we've just updated the logic slightly to permit 0 length buffers.
Verification
Packaging changes reviewed?
Addresses #31299