Skip to content

Bug in the source code #2

@gogo9th

Description

@gogo9th

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions