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

incorrect use of buffer pool #47

Closed
marten-seemann opened this issue Feb 17, 2021 · 0 comments · Fixed by #48
Closed

incorrect use of buffer pool #47

marten-seemann opened this issue Feb 17, 2021 · 0 comments · Fixed by #48
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@marten-seemann
Copy link
Contributor

In Read, we reslice the buffer:

s.b[0] = s.b[0][n:]

When returning this buffer to the pool, it will have a shorter length than the buffer we took from the buffer. Even worse, as we're using a pool, the bytes at the beginning of the buffer will be wasted eternally.

@marten-seemann marten-seemann added the kind/bug A bug in existing code (including security flaws) label Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant