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

Change behavior of encode_into with offset > len(buf) #753

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented Oct 20, 2024

Previously we'd truncate offset = len(buf) if offset > len(buf) when calling encode_into(msg, buf, offset). We now expand the size of buf to offset, providing a more consistent and expected behavior.

Fixes #697.

Previously we'd truncate `offset = len(buf)` if `offset > len(buf)` when
calling `encode_into(msg, buf, offset)`. We now expand the size of `buf`
to `offset`, providing a more consistent and expected behavior.
@jcrist jcrist merged commit c80616a into main Oct 20, 2024
7 checks passed
@jcrist jcrist deleted the encode-into-extend-offset branch October 20, 2024 19:12
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 this pull request may close these issues.

Encode_into might not write data at the intended offset location if buffer is too small.
1 participant