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

Fix encode_buf when a maximal-length run is immediately followed by a zero #3

Merged
merged 3 commits into from Nov 10, 2022

Conversation

jgallagher
Copy link
Contributor

Prior to this change, encode_buf() would erroneously omit an encoded zero byte if that zero byte was immediately preceded by a MAX_LEN-length run. In addition to a fix, this PR adds:

  • A test fixture with a buffer that triggers this case
  • A fuzz test comparing encode_buf against encode_iter (which handled this case correctly)
  • A fuzz test that round trips through encode_buf and decode_in_place

Copy link
Owner

@cbiffle cbiffle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

@cbiffle cbiffle merged commit 010a9ee into cbiffle:main Nov 10, 2022
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.

None yet

2 participants