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

cmp: check length off-by-one #450

Merged
merged 1 commit into from
Feb 11, 2024
Merged

Commits on Feb 10, 2024

  1. cmp: check length off-by-one

    * $checklength is the maximum offset in buffer to check which byte(s) in the 2 buffers are not equal
    * The subsequent loop is from 0 to $checklength, so avoid potentially accessing $bytes1[$chunk_size]
    * If $read_in1 and $read_in2 are equal to $chunk_size, the value of $checklength is not decremented
    * Calculate minimum of $read_in1 and $read_in2 (these will never exceed $chunk_size), then decrement by 1
    mknos authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    f76ab0b View commit details
    Browse the repository at this point in the history