-
Notifications
You must be signed in to change notification settings - Fork 3
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
Non 0 marker is incorrectly implemented. #1
Comments
Thank you for bringing this to my attention. I will have a look at fixing this on Friday. |
coastalwhite
added a commit
that referenced
this issue
Jul 29, 2022
coastalwhite
added a commit
that referenced
this issue
Jul 29, 2022
Thank you, Johan. This should now be fixed in version 1.1.2. |
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The library is not able to remove occurrences of the selected marker when the marker is not NULL. If the length to the next encoded byte is equal to the marker, it ends up in the output. See the following test:
If we print the encoded string we find there are A characters in it (and the assert fails):
"A----------------------------------------------------------------A----------------------------------------------------------------"
Since the distance to the next A is equal to A, they still end up in the output buffer.
I have skimmed through the COBS specification papers. The suggested way to handle this case is to first eliminate any zeros, and then XOR the output buffer with the value to be eliminated (i.e. A in this case)
Here follows an extract from page 4 of the Consistent Overhead Byte Stuffing paper:
http://conferences.sigcomm.org/sigcomm/1997/papers/p062.pdf
The text was updated successfully, but these errors were encountered: