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

Fix Icon(Stream) handling of partial reads #82621

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

stephentoub
Copy link
Member

Icon's ctor assumes Read on a stream will always produce as much data as was asked for, and that's not guaranteed to be the case.

Fixes #80261

Icon's ctor assumes Read on a stream will always produce as much data as was asked for, and that's not guaranteed to be the case.
@ghost
Copy link

ghost commented Feb 24, 2023

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

Issue Details

Icon's ctor assumes Read on a stream will always produce as much data as was asked for, and that's not guaranteed to be the case.

Fixes #80261

Author: stephentoub
Assignees: -
Labels:

area-System.Drawing

Milestone: -

@stephentoub stephentoub merged commit bac3bef into dotnet:main Mar 2, 2023
@stephentoub stephentoub deleted the fixiconctor branch March 2, 2023 17:04
stream.Read(_iconData, 0, _iconData.Length);
#if NET7_0_OR_GREATER
stream.ReadExactly(_iconData);
#else
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to backport this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. It's been like this forever and to my knowledge no one has complained. I found it via an audit rather than feedback.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2023
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.

Icon/Image from Stream doesn't work for partial reads
3 participants