-
Notifications
You must be signed in to change notification settings - Fork 8
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
Avoid return new MemoryStream, instead return null and manage nulls i… #661
Merged
Conversation
This file contains 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
…n the caller methods.
Cherry pick to beta failed, 2 conflicted files in commit f63c717
|
Manual cherry pick to beta success |
Cherry pick to beta success |
Cherry pick to beta success |
claudiamurialdo
previously approved these changes
Aug 9, 2022
Cherry pick to beta failed, 0 conflicted files in commit a2b3e0f (warning: no changes merged) |
Manual cherry pick to beta success |
Cherry pick to beta success |
… the stream ReceiveStream is changed by a byte[] array to avoid potential Improper Resource Shutdown errors when used outside StandardClasses.
Cherry pick to beta success |
Cherry pick to beta success |
Cherry pick to beta success |
claudiamurialdo
previously approved these changes
Aug 16, 2022
Cherry pick to beta success |
…HttpRequest.GetStringFromStream. Default value for bufferSize argument in StreamReader constructor is 1024 for .NET Framework and -1 for .NET.
Cherry pick to beta success |
claudiamurialdo
approved these changes
Sep 22, 2022
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.
Veracode was reporting several "Improper Resource Shutdown or Release", the root cause of this in our case was that we return MemoryStreams in many places just to avoid handling the nulls. The side effect of this practice is that we are spreading disposable objects out the class boundary and nobody is releasing them.