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

Short UTF-8 Sequences will not be caught if InputStream does not support Length property #101

Open
R-maan opened this issue Mar 30, 2020 · 0 comments
Milestone

Comments

@R-maan
Copy link
Contributor

R-maan commented Mar 30, 2020

Due to the limitation of StreamReader.Read() where it returns -1 if no more characters are available - regardless whether there are any sequence left or not, we are using Stream.Length property to check for short sequences of UTF-8 inputs.

But not all the implementations of Stream will support Length.
If an implementation does not support Length property, short utf-8 sequences will not be caught.

@tgregg tgregg added this to the Post-GA milestone Mar 31, 2020
tgregg pushed a commit that referenced this issue Mar 31, 2020
#101 tracks the equivalent fix for non-seekable streams.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants