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

InOutBufReserved::get_out_len returns length of **input** buffer. #1146

Open
dequbed opened this issue Feb 4, 2025 · 2 comments · Fixed by #1147
Open

InOutBufReserved::get_out_len returns length of **input** buffer. #1146

dequbed opened this issue Feb 4, 2025 · 2 comments · Fixed by #1147

Comments

@dequbed
Copy link

dequbed commented Feb 4, 2025

Specifically this piece of code here:

pub fn get_out_len(&self) -> usize {
self.in_len
}

I'm unsure if this is intended, but I can't figure out any use case where this is correct. The current implementation is an issue when the output buffer does need to be oversized because e.g. padding to block size is added, and some code checks for this oversized attribute using the mentioned method.

You can work around this issue by writing

buf.get_out().len();

instead of

buf.get_out_len();

but this is obviously less ergonomic.

@newpavlov
Copy link
Member

Oh... It's certainly a bug. We probably should create a backport for inout v0.1.

@newpavlov
Copy link
Member

Reopened until the v0.1 backport is merged and published.

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

Successfully merging a pull request may close this issue.

2 participants