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

Possibility of reading too many bytes when reading NBT strings #26

Closed
UnknownShadow200 opened this issue Jun 28, 2018 · 2 comments
Closed
Milestone

Comments

@UnknownShadow200
Copy link

In NbtBinaryReader.cs:

while (stringBytesRead < length) {
  int bytesReadThisTime = BaseStream.Read(stringConversionBuffer, stringBytesRead, length);
  if (bytesReadThisTime == 0) {
    throw new EndOfStreamException();
  }
  stringBytesRead += bytesReadThisTime;
}

Should be length - stringBytesRead instead of just length

@mstefarov mstefarov added the bug label Jun 28, 2018
@mstefarov
Copy link
Owner

mstefarov commented Jun 28, 2018

This has been fixed in master by 0ab7375, thanks! I'll close this when I bake a fresh NuGet package for 0.6.4, later today this week.

@mstefarov mstefarov added this to the 0.6.4 milestone Jul 5, 2018
@mstefarov mstefarov added the wip label Jul 5, 2018
@mstefarov
Copy link
Owner

Fix released with v0.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants