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

org.takes.rq.ChunkedInputStream.read(byte[], int, int) behaves wrong if len > total size #1303

Open
laeubi opened this issue Jun 21, 2024 · 4 comments

Comments

@laeubi
Copy link

laeubi commented Jun 21, 2024

In ChunkedInputStream.read(byte[], int, int) there is this code:

result = shift + this.read(buf, off + shift, len - shift);

but if the next chunck is EOF, the method return -1 and therefore the method claims to have read one less byte!
Instead the return value must be checked, and if it is < 1 nothing should be added (or substracted in the current case).

@yegor256
Copy link
Owner

yegor256 commented Oct 2, 2024

@rultor release, tag is 1.24.5

@rultor
Copy link
Collaborator

rultor commented Oct 2, 2024

@rultor release, tag is 1.24.5

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Oct 2, 2024

@rultor release, tag is 1.24.5

@yegor256 Done! FYI, the full log is here (took me 23min)

@yegor256
Copy link
Owner

yegor256 commented Oct 2, 2024

@laeubi I believe it's fixed now, try latest version

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

3 participants