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

Bug in the source code #2

Open
gogo9th opened this issue Jun 20, 2019 · 0 comments
Open

Bug in the source code #2

gogo9th opened this issue Jun 20, 2019 · 0 comments

Comments

@gogo9th
Copy link

gogo9th commented Jun 20, 2019

Hi,

Thanks for your useful compression code. I found there is a bug in here. The line:
for(temp_pointer_length = 0; && uncompressed_text[look_ahead++] == uncompressed_text[look_behind++]; ++temp_pointer_length)

Should be changed to:
for(temp_pointer_length = 0; look_ahead < uncompressed_size && uncompressed_text[look_ahead++] == uncompressed_text[look_behind++]; ++temp_pointer_length)

Basically, we should check the array boundary: "look_ahead < uncompressed_size"

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

No branches or pull requests

1 participant