Skip to content

fix(patch): hunk range overflow panic #83

Merged
bmwill merged 2 commits intobmwill:masterfrom
weihanglo:overflow
Apr 24, 2026
Merged

fix(patch): hunk range overflow panic #83
bmwill merged 2 commits intobmwill:masterfrom
weihanglo:overflow

Conversation

@weihanglo
Copy link
Copy Markdown
Contributor

This fix was chosen becuase it is the minimal one.

The other two call sites are not affected, as the comes from slices, where the length is bound by isize::MAX IIUC: https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety.

Alternatively we can return an Option from HunkRange::new.

See

This fix was chosen becuase it is the minimal one.

The other two call sites are not affected,
as the comes from slices,
where the length is bound by `isize::MAX` IIUC:
<https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety>.

Alternatively we can return an `Option` from `HunkRange`.
@bmwill bmwill merged commit 077a7c4 into bmwill:master Apr 24, 2026
26 checks passed
@weihanglo weihanglo deleted the overflow branch April 24, 2026 14:58
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.

2 participants